forked from crypto-org-chain/cronos-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Problem] missing document for dynamic contract in unreal engine plugin
crypto-org-chain#286 add category fix typo fix typo add text add send blueprint add encode add call
- Loading branch information
1 parent
98315ae
commit 11d586c
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
cronos-play/getting-started_unreal/quick-start/dynamic-contract.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<figure><img src="../../../.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-call.png" alt=""><figcaption></figcaption></figure> | ||
|
||
|
||
|
||
## Send | ||
this is for modifying contract call. it needs `DefiWalletCoreActor` to sign the transaction. | ||
|
||
<figure><img src="../../../.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-send.png" alt=""><figcaption></figcaption></figure> | ||
|
||
|
||
|
||
## 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 | ||
<figure><img src="../../../.gitbook/assets/cronos-gamefi-blueprint-dynamic-contract-encode.png" alt=""><figcaption></figcaption></figure> | ||
|
||
|
||
## 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" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
``` |