--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + // Common stubs holder contract Dummy { uint8 dummy; @@ -21,7 +27,7 @@ } } -// Selector: 7b4866f9 +// Selector: 06fc42e9 contract ContractHelpers is Dummy, ERC165 { // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) @@ -35,10 +41,45 @@ return 0x0000000000000000000000000000000000000000; } - // Selector: sponsoringEnabled(address) 6027dc61 - function sponsoringEnabled(address contractAddress) + // Selector: setSponsor(address,address) f01fba93 + function setSponsor(address contractAddress, address sponsor) public { + require(false, stub_error); + contractAddress; + sponsor; + dummy = 0; + } + + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) public { + require(false, stub_error); + contractAddress; + dummy = 0; + } + + // Selector: getSponsor(address) 743fc745 + function getSponsor(address contractAddress) public view + returns (Tuple0 memory) + { + require(false, stub_error); + contractAddress; + dummy; + return Tuple0(0x0000000000000000000000000000000000000000, 0); + } + + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) public view returns (bool) { + require(false, stub_error); + contractAddress; + dummy; + return false; + } + + // Selector: hasPendingSponsor(address) 39b9b242 + function hasPendingSponsor(address contractAddress) + public + view returns (bool) { require(false, stub_error); @@ -47,14 +88,16 @@ return false; } - // Deprecated - // - // Selector: toggleSponsoring(address,bool) fcac6d86 - function toggleSponsoring(address contractAddress, bool enabled) public { + // Selector: sponsoringEnabled(address) 6027dc61 + function sponsoringEnabled(address contractAddress) + public + view + returns (bool) + { require(false, stub_error); contractAddress; - enabled; - dummy = 0; + dummy; + return false; } // Selector: setSponsoringMode(address,uint8) fde8a560 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + // Common stubs holder interface Dummy { @@ -12,7 +18,7 @@ function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Selector: 7b4866f9 +// Selector: 06fc42e9 interface ContractHelpers is Dummy, ERC165 { // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) @@ -20,16 +26,32 @@ view returns (address); + // Selector: setSponsor(address,address) f01fba93 + function setSponsor(address contractAddress, address sponsor) external; + + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) external; + + // Selector: getSponsor(address) 743fc745 + function getSponsor(address contractAddress) + external + view + returns (Tuple0 memory); + + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) external view returns (bool); + + // Selector: hasPendingSponsor(address) 39b9b242 + function hasPendingSponsor(address contractAddress) + external + view + returns (bool); + // Selector: sponsoringEnabled(address) 6027dc61 function sponsoringEnabled(address contractAddress) external view returns (bool); - - // Deprecated - // - // Selector: toggleSponsoring(address,bool) fcac6d86 - function toggleSponsoring(address contractAddress, bool enabled) external; // Selector: setSponsoringMode(address,uint8) fde8a560 function setSponsoringMode(address contractAddress, uint8 mode) external; --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -34,6 +34,19 @@ "type": "address" } ], + "name": "confirmSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], "name": "contractOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", @@ -47,6 +60,29 @@ "type": "address" } ], + "name": "getSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple0", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], "name": "getSponsoringRateLimit", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", @@ -58,7 +94,47 @@ "internalType": "address", "name": "contractAddress", "type": "address" + } + ], + "name": "hasPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "hasSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" }, + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, { "internalType": "uint8", "name": "mode", "type": "uint8" } ], "name": "setSponsoringMode", @@ -140,20 +216,6 @@ { "internalType": "bool", "name": "enabled", "type": "bool" } ], "name": "toggleAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - }, - { "internalType": "bool", "name": "enabled", "type": "bool" } - ], - "name": "toggleSponsoring", "outputs": [], "stateMutability": "nonpayable", "type": "function"