casper-network / condor-info

Casper 2.0 technical outreach
Apache License 2.0
3 stars 2 forks source link

KB Article: Contract migration to 2.0 #27

Closed sczembor closed 3 months ago

sczembor commented 4 months ago

Link to original codes because they might be (or are already) subject to change. runtime::get_call_stack behaves differently from 1.x versions. You are using cep-18 as an example but in said code the source of most changes is how we handle the new data structuring of runtime::get_call_stack ContractPackageHash was half removed in favour of the new PackageHash type which on .into() function call turns into Key::Package variant as opposed to the old ContractPackageHash which shared Key::Hash variant with ContractHash. get_caller on the otherhand currently still returns account_hash which might cause confusion with the developers as it turns into Key::Account while there is a new Key::AddressableEntity(Account) variant to side with the new Key::AddressableEntity(SmartContract) variant.

Applied all the suggestions. There is a note at the beginning saying that it is a WIP and may be subject to change as well as adding important information about get_caller_stack and get_caller to the migration steps. Thanks for the review