-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate Deployable
#2002
Comments
Hmm, can we simply make Deployable an empty binary receiver? What's the alternative for it, a Besides, |
This will break existing user tests |
I think we should offer alternative way to deploy contract right away in the docs and in the examples, maybe in form of new message type in generated wrappers, since it requires advanced knowledge of TON internals to know how We should have something like const contract = blockchain.openContract(
await Escrow.fromInit(
seller.address,
),
);
const deployResult = await contract.sendDeploy(
deployer.getSender(),
{
value: toNano("0.1"),
});
// Send deploy under the hood can be just simple empty send, something like
send({
to: escrowAddress,
value: toNano("0.05"),
body: beginCell().endCell(),
sendMode: SendMode.PAY_GAS_SEPARATELY,
}); Since contract deployment is a hot topic for all new web3 developers, especially in TON, I think we should carefully think about the design |
What about |
Can you expand on this please? You mean separate typescript class? |
No, I meant https://docs.tact-lang.org/ref/stdlib-deploy/#factorydeployable. Here's the |
I've got an idea — we place the following to trait EmptyDeployable {
/// `null` message body receiver for deployment purposes
receive() {}
}
trait CashbackDeployable {
/// `null` message body receiver for deployment purposes
/// Forwards the remaining value back to the sender
receive() { cashback() }
} UPD: Changed the |
That's good solution. I will propose an offer to smoother dev experience. In case of this specific trait being enabled on contract, let's generate additional method in the wrapper, |
trait NullDeployable { trait NullDeployable { @novusnota Did you mean |
instead of doing that import and using that trait I'd prefer to copy-paste |
also, I think it makes sense to have a trait version with something like |
The move to |
As a follow-up to my commment earlier, we might do the following:
message EmptyDeploy {}
message CashbackDeploy {}
trait EmptyDeployable {
/// Does not forward the remaining value back to the sender,
/// simply deploys the contract and/or receives funds
receive(_: EmptyDeploy) {}
}
trait CashbackDeployable {
/// Forwards the remaining value back to the sender
receive(_: CashbackDeploy) { cashback(sender()) }
} I'm unsure if those would be cheaper than a |
Deployable
,self.notify
from https://docs.tact-lang.org/#start-3Deployable
from our examples (Web IDE should be also adapted)Deployable
as deprecatedRelated issues: #1868, #1964
The text was updated successfully, but these errors were encountered: