diff --git a/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-call.png b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-call.png new file mode 100644 index 00000000..240623ca Binary files /dev/null and b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-call.png differ diff --git a/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-encode.png b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-encode.png new file mode 100644 index 00000000..40bd1ea2 Binary files /dev/null and b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-encode.png differ diff --git a/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-send.png b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-send.png new file mode 100644 index 00000000..fba5915c Binary files /dev/null and b/.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-send.png differ diff --git a/SUMMARY.md b/SUMMARY.md index ac52bc19..667406db 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -87,6 +87,7 @@ * [Creating a child DefiWalletCoreActor](cronos-play/getting-started\_unreal/working-with-c++/creating-a-child-defiwalletcoreactor.md) * [Querying a contract](cronos-play/getting-started\_unreal/working-with-c++/querying-a-contract.md) * [Customizing Network](cronos-play/getting-started\_unreal/working-with-c++/customizing-network.md) + * [Dynamic Contact](cronos-play/getting-started\_unreal/working-with-c++/dynamic-contact.md) * [Demo](cronos-play/getting-started\_unreal/demo.md) * [Cronos Play C++ SDK](cronos-play/getting-started\_cpp.md) * [Crypto.com Pay Integration](cronos-play/crypto.com-pay-integration.md) diff --git a/cronos-play/getting-started_unreal/quick-start/dynamic-contract.md b/cronos-play/getting-started_unreal/quick-start/dynamic-contract.md new file mode 100644 index 00000000..3fc30b2c --- /dev/null +++ b/cronos-play/getting-started_unreal/quick-start/dynamic-contract.md @@ -0,0 +1,122 @@ +# Dynamic Contract + +with Dynamic Contract, you can call any smartcontract. you need abi json file for the contract. +- create contract beforehand, prepare contract address +- prepare abi json file for the contract to access + + + +## Call +this is for non modifying contract call + +
+ + + +## Send +this is for modifying contract call. it needs `DefiWalletCoreActor` to sign the transaction. + +
+ + + +## Encode +this is for wallet-connect. it generates data which can be included in the transaction. and the transaction can be signed with wallet-connect +
+ + +## For function arguments encoding +### Sample for safeMint + - solidity function signature: + ``` + safeMint(address,string) + ``` +- funciton name: +``` +safeMint +``` +- function arguments: +``` +[{"Address":{"data":"0x00"}},{"Str":{"data":"my"}}] +``` + +### Sample for all types +``` +[ + { + "Address": { + "data": "0x0000000000000000000000000000000000000000" + } + }, + { + "FixedBytes": { + "data": [ + 1, + 2 + ] + } + }, + { + "Bytes": { + "data": [ + 1, + 2 + ] + } + }, + { + "Int": { + "data": "1" + } + }, + { + "Uint": { + "data": "1" + } + }, + { + "Bool": { + "data": true + } + }, + { + "Str": { + "data": "test" + } + }, + { + "FixedArray": { + "data": [ + { + "Int": { + "data": "1" + } + } + ] + } + }, + { + "Array": { + "data": [ + { + "Int": { + "data": "1" + } + } + ] + } + }, + { + "Tuple": { + "data": [ + { + "Int": { + "data": "1" + } + } + ] + } + } +] + +```