Skip to content

Commit

Permalink
feat: adds example HRC904 contracts + new methods to HTS contract (#1125
Browse files Browse the repository at this point in the history
)

* feat: example contracts + airdrop test coverage

Signed-off-by: Simeon Nakov <[email protected]>

* feat: hrc904 proxy test coverage

Signed-off-by: Simeon Nakov <[email protected]>

* feat: airdropContract test + contract fixes

Signed-off-by: Simeon Nakov <[email protected]>

* feat: add tmate for tests

Signed-off-by: Simeon Nakov <[email protected]>

* feat: changed Airdrop tests to get response code of the child transaction successfully

Signed-off-by: Simeon Nakov <[email protected]>

* feat: unstaging proxy contract tests

Signed-off-by: Simeon Nakov <[email protected]>

* feat: uncommented test after debugging

Signed-off-by: Simeon Nakov <[email protected]>

* feat: removed console logs and modified gas limit to one test

Signed-off-by: Simeon Nakov <[email protected]>

* feat: renamed constant, added comments to example contracts,

Signed-off-by: Simeon Nakov <[email protected]>

* feat: removed unnecessary clarification in a code comment

Signed-off-by: Simeon Nakov <[email protected]>

* feat: addressed requested changes from #1125 + left out Airdrop contract test coverage for a later PR

Signed-off-by: Simeon Nakov <[email protected]>

* feat: removed AirdropContract.js

Signed-off-by: Simeon Nakov <[email protected]>

* feat: recompiled contracts

Signed-off-by: Simeon Nakov <[email protected]>

* feat: removed unused event from contract

Signed-off-by: Simeon Nakov <[email protected]>

* feat: removed test coverage related functions and constants from current PR

Signed-off-by: Simeon Nakov <[email protected]>

* feat: clean up tests folder

Signed-off-by: Simeon Nakov <[email protected]>

* feat: recompiled contracts

Signed-off-by: Simeon Nakov <[email protected]>

* feat: renamed prepareAA method

Signed-off-by: Simeon Nakov <[email protected]>

---------

Signed-off-by: Simeon Nakov <[email protected]>
Co-authored-by: konstantinabl <[email protected]>
  • Loading branch information
simzzz and konstantinabl authored Jan 16, 2025
1 parent 47452c4 commit e00a81f
Show file tree
Hide file tree
Showing 21 changed files with 2,913 additions and 10 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "HRC904Contract",
"sourceName": "contracts/system-contracts/hedera-token-service/examples/hrc-904/HRC904Contract.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "cancelAirdropFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"internalType": "int64",
"name": "serial",
"type": "int64"
}
],
"name": "cancelAirdropNFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "claimAirdropFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "int64",
"name": "serial",
"type": "int64"
}
],
"name": "claimAirdropNFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "rejectTokenFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "int64[]",
"name": "serialNumbers",
"type": "int64[]"
}
],
"name": "rejectTokenNFTs",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "bool",
"name": "enableAutoAssociations",
"type": "bool"
}
],
"name": "setUnlimitedAssociations",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561000f575f80fd5b506105bb8061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063b1711d5411610058578063b1711d54146100ce578063cec8cb7a146100e1578063e1588b8e146100f4578063ed6c8f5e14610107575f80fd5b806332ea43071461007e57806375371d8f146100a857806385047407146100bb575b5f80fd5b61009161008c36600461035a565b61011a565b60405160079190910b815260200160405180910390f35b6100916100b63660046103a7565b61018e565b6100916100c93660046103eb565b61020d565b6100916100dc366004610438565b61023d565b6100916100ef3660046103a7565b61026b565b61009161010236600461050b565b6102a6565b61009161011536600461035a565b61030e565b60405163541de2d960e11b81526001600160a01b0382811660048301525f919084169063a83bc5b2906024015b6020604051808303815f875af1158015610163573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101879190610524565b9392505050565b6040516363ada5d760e01b81526001600160a01b038381166004830152600783900b60248301525f91908516906363ada5d7906044015b6020604051808303815f875af11580156101e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102059190610524565b949350505050565b60405163f5677e9960e01b815281151560048201525f906001600160a01b0384169063f5677e9990602401610147565b604051635434e3c560e11b81525f906001600160a01b0384169063a869c78a9061014790859060040161053f565b60405163ad4917cf60e01b81526001600160a01b038381166004830152600783900b60248301525f919085169063ad4917cf906044016101c5565b5f816001600160a01b03166376c6b3916040518163ffffffff1660e01b81526004016020604051808303815f875af11580156102e4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103089190610524565b92915050565b60405163cef5b70560e01b81526001600160a01b0382811660048301525f919084169063cef5b70590602401610147565b80356001600160a01b0381168114610355575f80fd5b919050565b5f806040838503121561036b575f80fd5b6103748361033f565b91506103826020840161033f565b90509250929050565b8060070b8114610399575f80fd5b50565b80356103558161038b565b5f805f606084860312156103b9575f80fd5b6103c28461033f565b92506103d06020850161033f565b915060408401356103e08161038b565b809150509250925092565b5f80604083850312156103fc575f80fd5b6104058361033f565b915060208301358015158114610419575f80fd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f8060408385031215610449575f80fd5b6104528361033f565b915060208084013567ffffffffffffffff8082111561046f575f80fd5b818601915086601f830112610482575f80fd5b81358181111561049457610494610424565b8060051b604051601f19603f830116810181811085821117156104b9576104b9610424565b6040529182528482019250838101850191898311156104d6575f80fd5b938501935b828510156104fb576104ec8561039c565b845293850193928501926104db565b8096505050505050509250929050565b5f6020828403121561051b575f80fd5b6101878261033f565b5f60208284031215610534575f80fd5b81516101878161038b565b602080825282518282018190525f9190848201906040850190845b8181101561057957835160070b8352928401929184019160010161055a565b5090969550505050505056fea26469706673582212203e44b739ad7dad9cb033ed1fe25f35444cac75b2441edbc67ced89f92a7981ad64736f6c63430008180033",
"deployedBytecode": "0x608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063b1711d5411610058578063b1711d54146100ce578063cec8cb7a146100e1578063e1588b8e146100f4578063ed6c8f5e14610107575f80fd5b806332ea43071461007e57806375371d8f146100a857806385047407146100bb575b5f80fd5b61009161008c36600461035a565b61011a565b60405160079190910b815260200160405180910390f35b6100916100b63660046103a7565b61018e565b6100916100c93660046103eb565b61020d565b6100916100dc366004610438565b61023d565b6100916100ef3660046103a7565b61026b565b61009161010236600461050b565b6102a6565b61009161011536600461035a565b61030e565b60405163541de2d960e11b81526001600160a01b0382811660048301525f919084169063a83bc5b2906024015b6020604051808303815f875af1158015610163573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101879190610524565b9392505050565b6040516363ada5d760e01b81526001600160a01b038381166004830152600783900b60248301525f91908516906363ada5d7906044015b6020604051808303815f875af11580156101e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102059190610524565b949350505050565b60405163f5677e9960e01b815281151560048201525f906001600160a01b0384169063f5677e9990602401610147565b604051635434e3c560e11b81525f906001600160a01b0384169063a869c78a9061014790859060040161053f565b60405163ad4917cf60e01b81526001600160a01b038381166004830152600783900b60248301525f919085169063ad4917cf906044016101c5565b5f816001600160a01b03166376c6b3916040518163ffffffff1660e01b81526004016020604051808303815f875af11580156102e4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103089190610524565b92915050565b60405163cef5b70560e01b81526001600160a01b0382811660048301525f919084169063cef5b70590602401610147565b80356001600160a01b0381168114610355575f80fd5b919050565b5f806040838503121561036b575f80fd5b6103748361033f565b91506103826020840161033f565b90509250929050565b8060070b8114610399575f80fd5b50565b80356103558161038b565b5f805f606084860312156103b9575f80fd5b6103c28461033f565b92506103d06020850161033f565b915060408401356103e08161038b565b809150509250925092565b5f80604083850312156103fc575f80fd5b6104058361033f565b915060208301358015158114610419575f80fd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f8060408385031215610449575f80fd5b6104528361033f565b915060208084013567ffffffffffffffff8082111561046f575f80fd5b818601915086601f830112610482575f80fd5b81358181111561049457610494610424565b8060051b604051601f19603f830116810181811085821117156104b9576104b9610424565b6040529182528482019250838101850191898311156104d6575f80fd5b938501935b828510156104fb576104ec8561039c565b845293850193928501926104db565b8096505050505050509250929050565b5f6020828403121561051b575f80fd5b6101878261033f565b5f60208284031215610534575f80fd5b81516101878161038b565b602080825282518282018190525f9190848201906040850190845b8181101561057957835160070b8352928401929184019160010161055a565b5090969550505050505056fea26469706673582212203e44b739ad7dad9cb033ed1fe25f35444cac75b2441edbc67ced89f92a7981ad64736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Loading

0 comments on commit e00a81f

Please sign in to comment.