Skip to content

Commit

Permalink
[Problem] missing document for dynamic contract in unreal engine plugin
Browse files Browse the repository at this point in the history
crypto-org-chain#286

add category

fix typo

fix typo

add text

add send blueprint

add encode

add call
  • Loading branch information
leejw51crypto committed Dec 20, 2022
1 parent 98315ae commit 11d586c
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
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.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
122 changes: 122 additions & 0 deletions cronos-play/getting-started_unreal/quick-start/dynamic-contract.md
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"
}
}
]
}
}
]
```

0 comments on commit 11d586c

Please sign in to comment.