Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds test coverage for Airdrop Contract + IHRC904 proxy methods #1

Draft
wants to merge 8 commits into
base: 1012-proxy-coverage
Choose a base branch
from
9 changes: 9 additions & 0 deletions .github/workflows/manual-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ jobs:
mirrorTag: ${{inputs.mirrorNodeTag}}
relayTag: ${{inputs.relayTag}}

HIP904:
name: HIP904 Test Suite
uses: ./.github/workflows/test-workflow.yml
with:
testfilter: HRC-904
networkTag: ${{inputs.networkNodeTag}}
mirrorTag: ${{inputs.mirrorNodeTag}}
relayTag: ${{inputs.relayTag}}

ShanghaiOpcodes:
name: ShanghaiOpcodes Test Suite
uses: ./.github/workflows/test-workflow.yml
Expand Down

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,156 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "TokenReject",
"sourceName": "contracts/system-contracts/hedera-token-service/examples/hrc-904/TokenReject.sol",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"indexed": false,
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"name": "CallResponseEvent",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "bytes",
"name": "encodedFunctionSelector",
"type": "bytes"
}
],
"name": "redirectForToken",
"outputs": [
{
"internalType": "int256",
"name": "responseCode",
"type": "int256"
},
{
"internalType": "bytes",
"name": "response",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "rejectingAddress",
"type": "address"
},
{
"internalType": "address[]",
"name": "ftAddresses",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "nftAddresses",
"type": "address[]"
}
],
"name": "rejectTokens",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "serialNumber",
"type": "uint256"
}
],
"name": "transferFromNFT",
"outputs": [
{
"internalType": "int64",
"name": "responseCode",
"type": "int64"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561000f575f80fd5b506108f88061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c806315dacbea1461004e5780632d03d39014610079578063618dc65e1461008c5780639b23d3d9146100ad575b5f80fd5b61006161005c3660046104ff565b6100c0565b60405160079190910b81526020015b60405180910390f35b610061610087366004610610565b6101af565b61009f61009a36600461067f565b6102af565b60405161007092919061076c565b6100616100bb3660046104ff565b6103c6565b6040516001600160a01b038581166024830152848116604483015283166064820152608481018290525f908190819061016790630aed65f560e11b9060a4015b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161013e919061078c565b5f604051808303815f865af19150503d805f8114610177576040519150601f19603f3d011682016040523d82523d5f602084013e61017c565b606091505b50915091508161018d5760156101a1565b808060200190518101906101a191906107a7565b60030b979650505050505050565b5f80825167ffffffffffffffff8111156101cb576101cb610547565b60405190808252806020026020018201604052801561020f57816020015b604080518082019091525f80825260208201528152602001906001900390816101e95790505b5090505f5b835181101561028957604080518082019091525f8082526020820152848281518110610242576102426107ce565b6020908102919091018101516001600160a01b0316825260019082015282518190849084908110610275576102756107ce565b602090810291909101015250600101610214565b5061029585858361040a565b9150600782900b6016146102a7575f80fd5b509392505050565b5f60605f806101676001600160a01b031663618dc65e60e01b87876040516024016102db9291906107e2565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610319919061078c565b5f604051808303815f865af19150503d805f8114610352576040519150601f19603f3d011682016040523d82523d5f602084013e610357565b606091505b50915091507f4af4780e06fe8cb9df64b0794fa6f01399af979175bb988e35e0e57e594567bc828260405161038d929190610803565b60405180910390a1816103b057601560405180602001604052805f8152506103b4565b6016815b60039190910b97909650945050505050565b6040516001600160a01b038581166024830152848116604483015283166064820152608481018290525f908190819061016790639b23d3d960e01b9060a401610100565b5f805f6101676001600160a01b031663ebd595e060e01b8787876040516024016104369392919061081d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610474919061078c565b5f604051808303815f865af19150503d805f81146104ad576040519150601f19603f3d011682016040523d82523d5f602084013e6104b2565b606091505b5091509150816104c35760156104d7565b808060200190518101906104d791906107a7565b60030b9695505050505050565b80356001600160a01b03811681146104fa575f80fd5b919050565b5f805f8060808587031215610512575f80fd5b61051b856104e4565b9350610529602086016104e4565b9250610537604086016104e4565b9396929550929360600135925050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561058457610584610547565b604052919050565b5f82601f83011261059b575f80fd5b8135602067ffffffffffffffff8211156105b7576105b7610547565b8160051b6105c682820161055b565b92835284810182019282810190878511156105df575f80fd5b83870192505b84831015610605576105f6836104e4565b825291830191908301906105e5565b979650505050505050565b5f805f60608486031215610622575f80fd5b61062b846104e4565b9250602084013567ffffffffffffffff80821115610647575f80fd5b6106538783880161058c565b93506040860135915080821115610668575f80fd5b506106758682870161058c565b9150509250925092565b5f8060408385031215610690575f80fd5b610699836104e4565b915060208084013567ffffffffffffffff808211156106b6575f80fd5b818601915086601f8301126106c9575f80fd5b8135818111156106db576106db610547565b6106ed601f8201601f1916850161055b565b91508082528784828501011115610702575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f5b83811015610739578181015183820152602001610721565b50505f910152565b5f815180845261075881602086016020860161071f565b601f01601f19169290920160200192915050565b828152604060208201525f6107846040830184610741565b949350505050565b5f825161079d81846020870161071f565b9190910192915050565b5f602082840312156107b7575f80fd5b81518060030b81146107c7575f80fd5b9392505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b0383168152604060208201525f6107846040830184610741565b8215158152604060208201525f6107846040830184610741565b5f606082016001600160a01b038087168452602060608186015282875180855260808701915082890194505f5b8181101561086857855185168352948301949183019160010161084a565b5050604093508581036040870152808751808352838301915083890192505f5b818110156108b257835180518716845285015160070b858401529284019291860191600101610888565b50909a995050505050505050505056fea2646970667358221220b3d2b405fb71730aa941f6ca8c392fc65a6c113072b5123721f4ce40d79e930d64736f6c63430008180033",
"deployedBytecode": "0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c806315dacbea1461004e5780632d03d39014610079578063618dc65e1461008c5780639b23d3d9146100ad575b5f80fd5b61006161005c3660046104ff565b6100c0565b60405160079190910b81526020015b60405180910390f35b610061610087366004610610565b6101af565b61009f61009a36600461067f565b6102af565b60405161007092919061076c565b6100616100bb3660046104ff565b6103c6565b6040516001600160a01b038581166024830152848116604483015283166064820152608481018290525f908190819061016790630aed65f560e11b9060a4015b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161013e919061078c565b5f604051808303815f865af19150503d805f8114610177576040519150601f19603f3d011682016040523d82523d5f602084013e61017c565b606091505b50915091508161018d5760156101a1565b808060200190518101906101a191906107a7565b60030b979650505050505050565b5f80825167ffffffffffffffff8111156101cb576101cb610547565b60405190808252806020026020018201604052801561020f57816020015b604080518082019091525f80825260208201528152602001906001900390816101e95790505b5090505f5b835181101561028957604080518082019091525f8082526020820152848281518110610242576102426107ce565b6020908102919091018101516001600160a01b0316825260019082015282518190849084908110610275576102756107ce565b602090810291909101015250600101610214565b5061029585858361040a565b9150600782900b6016146102a7575f80fd5b509392505050565b5f60605f806101676001600160a01b031663618dc65e60e01b87876040516024016102db9291906107e2565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610319919061078c565b5f604051808303815f865af19150503d805f8114610352576040519150601f19603f3d011682016040523d82523d5f602084013e610357565b606091505b50915091507f4af4780e06fe8cb9df64b0794fa6f01399af979175bb988e35e0e57e594567bc828260405161038d929190610803565b60405180910390a1816103b057601560405180602001604052805f8152506103b4565b6016815b60039190910b97909650945050505050565b6040516001600160a01b038581166024830152848116604483015283166064820152608481018290525f908190819061016790639b23d3d960e01b9060a401610100565b5f805f6101676001600160a01b031663ebd595e060e01b8787876040516024016104369392919061081d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610474919061078c565b5f604051808303815f865af19150503d805f81146104ad576040519150601f19603f3d011682016040523d82523d5f602084013e6104b2565b606091505b5091509150816104c35760156104d7565b808060200190518101906104d791906107a7565b60030b9695505050505050565b80356001600160a01b03811681146104fa575f80fd5b919050565b5f805f8060808587031215610512575f80fd5b61051b856104e4565b9350610529602086016104e4565b9250610537604086016104e4565b9396929550929360600135925050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561058457610584610547565b604052919050565b5f82601f83011261059b575f80fd5b8135602067ffffffffffffffff8211156105b7576105b7610547565b8160051b6105c682820161055b565b92835284810182019282810190878511156105df575f80fd5b83870192505b84831015610605576105f6836104e4565b825291830191908301906105e5565b979650505050505050565b5f805f60608486031215610622575f80fd5b61062b846104e4565b9250602084013567ffffffffffffffff80821115610647575f80fd5b6106538783880161058c565b93506040860135915080821115610668575f80fd5b506106758682870161058c565b9150509250925092565b5f8060408385031215610690575f80fd5b610699836104e4565b915060208084013567ffffffffffffffff808211156106b6575f80fd5b818601915086601f8301126106c9575f80fd5b8135818111156106db576106db610547565b6106ed601f8201601f1916850161055b565b91508082528784828501011115610702575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f5b83811015610739578181015183820152602001610721565b50505f910152565b5f815180845261075881602086016020860161071f565b601f01601f19169290920160200192915050565b828152604060208201525f6107846040830184610741565b949350505050565b5f825161079d81846020870161071f565b9190910192915050565b5f602082840312156107b7575f80fd5b81518060030b81146107c7575f80fd5b9392505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b0383168152604060208201525f6107846040830184610741565b8215158152604060208201525f6107846040830184610741565b5f606082016001600160a01b038087168452602060608186015282875180855260808701915082890194505f5b8181101561086857855185168352948301949183019160010161084a565b5050604093508581036040870152808751808352838301915083890192505f5b818110156108b257835180518716845285015160070b858401529284019291860191600101610888565b50909a995050505050505050505056fea2646970667358221220b3d2b405fb71730aa941f6ca8c392fc65a6c113072b5123721f4ce40d79e930d64736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading