Migrating from Scrypto v0.5 to v0.6
Most of the changes introduced in Scrypto v0.6 was to make it work with Alphanet. This means that nothing much changed in the Scrypto syntax. In fact, one of the only changes you will notice is a small update to the way you write transaction manifests.
CALL_METHOD_WITH_ALL_RESOURCES that was most often used to empty the worktop and send its content back into an account so that no resources is left and forgotten, was removed. There is now a clearer way of doing that exact thing. Here is an example:
CALL_METHOD ComponentAddress("[your_address]") "deposit_batch" Expression("ENTIRE_WORKTOP");
Notice that there is now a single instruction to call methods (
CALL_METHOD). If you want to create a vector containing all the resources present on the worktop, and send it as an argument, you can use the
If you need it, you can also create a vector containing all the proofs present on the AuthZone with the following expression:
In previous versions, you used to provide a single parameter to the
PUBLISH_PACKAGE instruction consisting of the whole compiled package binary. You now have to provide two parameters. The first one is a
Blob representing the compiled binary and the second is a
Blob representing the abi file. You would then provide the
.abi files along with the signed transaction when submitting it to the network.
This is some complicated low-level stuff. If you want to publish a package on the Alphanet we recommend using this publishing tool where you upload both files and the transaction intent is automatically built.
You can now create fungible resources using the transaction manifest with the new
CREATE_RESOURCE instruction. For example, you can create a simple fungible resource with a divisibility of 18 and an initial supply of 1000 like this:
CREATE_RESOURCE Enum("Fungible", 18u8) Map<String, String>("name", "My Token", "symbol", "TKN") Map<Enum, Tuple>(Enum("Withdraw"), Tuple(Enum("AllowAll"), Enum("LOCKED"))) Some(Enum("Fungible", Decimal("1000")));
You can now burn bucket directly from the transaction manifest with the
BURN_BUCKET Bucket("name") instruction.