diff --git a/artifacts/contracts/Reputation.sol/Reputation.dbg.json b/artifacts/contracts/Reputation.sol/Reputation.dbg.json index 8bc604e..6f4fea0 100644 --- a/artifacts/contracts/Reputation.sol/Reputation.dbg.json +++ b/artifacts/contracts/Reputation.sol/Reputation.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/Reputation.sol/Reputation.json b/artifacts/contracts/Reputation.sol/Reputation.json index c56dcd7..6f2b440 100644 --- a/artifacts/contracts/Reputation.sol/Reputation.json +++ b/artifacts/contracts/Reputation.sol/Reputation.json @@ -5,7 +5,7 @@ "abi": [ { "inputs": [], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "constructor" }, { @@ -54,8 +54,8 @@ "type": "function" } ], - "bytecode": "0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033", - "deployedBytecode": "0x6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033", + "bytecode": "0x6080806040526102c990816100128239f3fe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033", + "deployedBytecode": "0x6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/artifacts/contracts/core/BaseUtils.sol/BaseUtils.dbg.json b/artifacts/contracts/core/BaseUtils.sol/BaseUtils.dbg.json index 59166bc..c80ca42 100644 --- a/artifacts/contracts/core/BaseUtils.sol/BaseUtils.dbg.json +++ b/artifacts/contracts/core/BaseUtils.sol/BaseUtils.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/core/BaseUtils.sol/BaseUtils.json b/artifacts/contracts/core/BaseUtils.sol/BaseUtils.json index b4e72a7..6cd6c4c 100644 --- a/artifacts/contracts/core/BaseUtils.sol/BaseUtils.json +++ b/artifacts/contracts/core/BaseUtils.sol/BaseUtils.json @@ -83,6 +83,11 @@ "name": "OnlySeller", "type": "error" }, + { + "inputs": [], + "name": "Reentrancy", + "type": "error" + }, { "inputs": [], "name": "StaticCallFailed", @@ -330,6 +335,25 @@ "name": "RootUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "TrustedForwarderUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -438,6 +462,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "getStr", + "outputs": [ + { + "internalType": "bytes32", + "name": "strEnc", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -522,6 +584,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "forwarders", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "states", + "type": "bool[]" + } + ], + "name": "setTrustedFowarders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/artifacts/contracts/core/Constants.sol/Constants.dbg.json b/artifacts/contracts/core/Constants.sol/Constants.dbg.json index 59166bc..c80ca42 100644 --- a/artifacts/contracts/core/Constants.sol/Constants.dbg.json +++ b/artifacts/contracts/core/Constants.sol/Constants.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/core/DataTypes.sol/DataTypes.dbg.json b/artifacts/contracts/core/DataTypes.sol/DataTypes.dbg.json index 31c2d9a..c80ca42 100644 --- a/artifacts/contracts/core/DataTypes.sol/DataTypes.dbg.json +++ b/artifacts/contracts/core/DataTypes.sol/DataTypes.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../build-info/c96aab92784d63ce08c6b112913f46c8.json" + "buildInfo": "../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/core/DataTypes.sol/DataTypes.json b/artifacts/contracts/core/DataTypes.sol/DataTypes.json index 4d2fd64..2ee0216 100644 --- a/artifacts/contracts/core/DataTypes.sol/DataTypes.json +++ b/artifacts/contracts/core/DataTypes.sol/DataTypes.json @@ -3,8 +3,8 @@ "contractName": "DataTypes", "sourceName": "contracts/core/DataTypes.sol", "abi": [], - "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220ed19291aba408239fe7ce17eba420cb350ea83c88994bb2b37733371feac745f64736f6c63430008130033", - "deployedBytecode": "0x600080fdfea2646970667358221220ed19291aba408239fe7ce17eba420cb350ea83c88994bb2b37733371feac745f64736f6c63430008130033", + "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220a40e6f94f4c0b9a9cdd9ac64f98613aece8f5a3f084ee1eca35eba466df9810964736f6c63430008130033", + "deployedBytecode": "0x600080fdfea2646970667358221220a40e6f94f4c0b9a9cdd9ac64f98613aece8f5a3f084ee1eca35eba466df9810964736f6c63430008130033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.dbg.json b/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.dbg.json index 59166bc..c80ca42 100644 --- a/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.dbg.json +++ b/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json b/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json index aec78e0..68d67ee 100644 --- a/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json +++ b/artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json @@ -306,6 +306,25 @@ "name": "RootUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "TrustedForwarderUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ diff --git a/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.dbg.json b/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.dbg.json index 59166bc..c80ca42 100644 --- a/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.dbg.json +++ b/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json b/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json index 3508498..6363826 100644 --- a/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json +++ b/artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json @@ -330,6 +330,25 @@ "name": "RootUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "TrustedForwarderUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -400,6 +419,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -484,6 +522,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "forwarders", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "states", + "type": "bool[]" + } + ], + "name": "setTrustedFowarders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json b/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json +++ b/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json b/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json +++ b/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.dbg.json b/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.dbg.json new file mode 100644 index 0000000..3b65efe --- /dev/null +++ b/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" +} diff --git a/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.json b/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.json new file mode 100644 index 0000000..f3231c8 --- /dev/null +++ b/artifacts/contracts/lib/metatx/ERC2771Context.sol/Context.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Context", + "sourceName": "contracts/lib/metatx/ERC2771Context.sol", + "abi": [], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.dbg.json b/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.dbg.json new file mode 100644 index 0000000..3b65efe --- /dev/null +++ b/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" +} diff --git a/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.json b/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.json new file mode 100644 index 0000000..655f88f --- /dev/null +++ b/artifacts/contracts/lib/metatx/ERC2771Context.sol/ERC2771Context.json @@ -0,0 +1,30 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC2771Context", + "sourceName": "contracts/lib/metatx/ERC2771Context.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json b/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json +++ b/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json b/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json +++ b/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json b/artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json +++ b/artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json b/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json +++ b/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json b/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json +++ b/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json b/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +++ b/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json b/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json index c3f96c4..3b65efe 100644 --- a/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json +++ b/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/e227c161b97af39988677e65180082ec.json" + "buildInfo": "../../../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/p2pix.sol/P2PIX.dbg.json b/artifacts/contracts/p2pix.sol/P2PIX.dbg.json index 7cd1dbf..6f4fea0 100644 --- a/artifacts/contracts/p2pix.sol/P2PIX.dbg.json +++ b/artifacts/contracts/p2pix.sol/P2PIX.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/2fbad03752b21beeabf4fed16acdbf91.json" + "buildInfo": "../../build-info/291bd612212fb4c1e87cae2657c915eb.json" } diff --git a/artifacts/contracts/p2pix.sol/P2PIX.json b/artifacts/contracts/p2pix.sol/P2PIX.json index 7491af9..2cdebec 100644 --- a/artifacts/contracts/p2pix.sol/P2PIX.json +++ b/artifacts/contracts/p2pix.sol/P2PIX.json @@ -366,6 +366,25 @@ "name": "RootUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "TrustedForwarderUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -487,9 +506,9 @@ "type": "uint96" }, { - "internalType": "uint160", + "internalType": "string", "name": "_pixTarget", - "type": "uint160" + "type": "string" }, { "internalType": "bool", @@ -595,14 +614,57 @@ "name": "getPixTarget", "outputs": [ { - "internalType": "uint160", + "internalType": "bytes32", "name": "pixTarget", - "type": "uint160" + "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "seller", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "token", + "type": "address" + } + ], + "name": "getPixTargetString", + "outputs": [ + { + "internalType": "string", + "name": "pixTarget", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "getStr", + "outputs": [ + { + "internalType": "bytes32", + "name": "strEnc", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, { "inputs": [ { @@ -627,6 +689,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -689,26 +770,6 @@ ], "name": "mapLocks", "outputs": [ - { - "internalType": "uint80", - "name": "amount", - "type": "uint80" - }, - { - "internalType": "uint160", - "name": "pixTarget", - "type": "uint160" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "buyerAddress", - "type": "address" - }, { "internalType": "uint256", "name": "sellerKey", @@ -723,6 +784,26 @@ "internalType": "uint256", "name": "expirationBlock", "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "pixTarget", + "type": "bytes32" + }, + { + "internalType": "uint80", + "name": "amount", + "type": "uint80" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "buyerAddress", + "type": "address" } ], "stateMutability": "view", @@ -806,30 +887,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "sellerKey", - "type": "uint256" - }, - { - "internalType": "contract ERC20", - "name": "erc20", - "type": "address" - } - ], - "name": "sellerBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "packed", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -887,6 +944,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "forwarders", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "states", + "type": "bool[]" + } + ], + "name": "setTrustedFowarders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1041,8 +1116,8 @@ "type": "receive" } ], - "bytecode": "0x60806040526200293e80380380620000178162000126565b928339810160a0828203126200010b5781516020808401519093916001600160401b03918281116200010b5784620000519185016200017f565b9062000060604085016200016a565b9260608501518181116200010b57866200007c9187016200017f565b9460808101519182116200010b57019480601f870112156200010b578551620000af620000a98262000152565b62000126565b96888089848152019260051b8201019283116200010b578801905b828210620000f157505050620000e19550620001e6565b6040516124fc9081620004428239f35b815180151581036200010b578152908801908801620000ca565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176200014c57604052565b62000110565b6001600160401b0381116200014c5760051b60200190565b51906001600160a01b03821682036200010b57565b9080601f830112156200010b578151906200019e620000a98362000152565b9182938184526020808095019260051b8201019283116200010b578301905b828210620001cc575050505090565b838091620001da846200016a565b815201910190620001bd565b600080546001600160a01b031916339081178255929695949392817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3816002556040519182527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208093a18651878301979060051b810183013d1515895b811562000306575b5050506040519280840191818552518092526040840198925b828110620002e85750505050907f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d782620002d593620002db97980390a16001600160a01b031662000337565b62000390565b620002e66001600355565b565b83516001600160a01b03168a52988101989281019260010162000289565b9085826001829697989451600c1b550190838210156200032c5791509493929462000268565b509493929462000270565b6000546001600160a01b0390811633036200037f57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360015560405191168152a1565b6040516282b42960e81b8152600490fd5b60008054919290916001600160a01b031633036200037f5782519182156200043457815183036200042757602092919284818080970195019360051b0101925b838103620003df575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003d0565b63ff633a3890526004601cfd5b63df95788390526004601cfdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc578063328a7181146101f7578063367821f0146101f2578063461f3120146101ac57806349ef8448146101ed5780634b2ae980146101e8578063574983c8146101e35780635fd8c710146101de57806369cc6af4146101d95780636d82d9e0146101d457806377cd38a4146101cf5780637f94f65d146101ca57806380e1d302146101c557806384ab1d28146101c05780638da5cb5b146101bb5780638db564c2146101b65780639872dbfe146101b157806398a26871146101ac5780639eee8d4b146101a7578063ad8f2eed146101a2578063b0983d391461019d578063c52164c614610198578063c593dfd814610193578063d1c070281461018e578063d4fac45d14610189578063d6e8b97314610184578063dc43221c1461017f578063f7d0e04b1461017a5763fb8c5ef00361000e5761142c565b6113bc565b611321565b611276565b61125d565b6111bb565b610e65565b610e31565b610df7565b610d70565b610d30565b610808565b610d12565b610cf4565b610cc0565b610c8a565b610c71565b610c20565b610be8565b610ad7565b610a97565b610a14565b6109b0565b610986565b6108eb565b610776565b610545565b610497565b61036a565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b6040519060e0820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f8201121561023257803591610319836102cc565b926103276040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610351575050505090565b838091833561035f816102e4565b815201910190610343565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039c903690600401610302565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046d57805181830192849160051b830181013d1515855b8115610439575b50505060405192818401908285525180915260408401949160005b828110610423577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f4565b90838260018298969499979951600c1b550190838210156104615791509593959492946103d2565b509593959492946103d9565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b4816102e4565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361023257565b3590811515820361023257565b346102325760a060031936011261023257600435610562816102e4565b6024356bffffffffffffffffffffffff8116908181036102325760443590610589826102e4565b610591610529565b6084359373ffffffffffffffffffffffffffffffffffffffff8087169033600c1b9086161561074c576105d96105d58363cbc9d1c4600c526000526020600c205490565b1590565b610722576b3fffffffffffffffffffffff61060a83839060205263739094b1600c52600c1c6000526034600c205490565b16906a52b7d2dcc80cd2e4000000610622858461163a565b116106f857826106e39761069c9661066e89610693967f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf9d610662611647565b806106e8575b5061163a565b9060ff1b91605f1b1717919060205263739094b1600c52600c1c6000526034600c2055565b30903390611682565b6106a66001600355565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2005b6106f29033611f47565b38610668565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b3461023257602060031936011261023257600435600052600560205260e0604060002080549073ffffffffffffffffffffffffffffffffffffffff90816001820154168260028301541660038301549160056004850154940154946040519669ffffffffffffffffffff8116885260501c16602087015260408601526060850152608084015260a083015260c0820152f35b34610232576020600319360112610232576020600435546040519015158152f35b90815180825260208080930193019160005b828110610849575050505090565b83518552938101939281019260010161083b565b9061087090604083526040830190610829565b81810360209283015282518082529082019282019160009190825b82811061089a57505050505090565b909192939485516004808210156108bf5750815282019482019392919060010161088b565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610232576020806003193601126102325760043567ffffffffffffffff8111610232573660238201121561023257806004013590610929826102cc565b916109376040519384610266565b80835260248484019160051b8301019136831161023257602401905b8282106109775761096384612362565b906109736040519283928361085d565b0390f35b81358152908401908401610953565b346102325760206003193601126102325760206004356109a5816102e4565b60405190600c1b8152f35b346102325760206003193601126102325760043573ffffffffffffffffffffffffffffffffffffffff60005416330361046d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600255604051908152a1005b3461023257600080600319360112610a945773ffffffffffffffffffffffffffffffffffffffff815416330361046d57478180808084335af115610a87576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b34610232576020600319360112610232576020610acd600435610ab9816102e4565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3461023257604060031936011261023257600435610af4816102e4565b602435801515908181036102325733600c1b610b2684829060205263739094b1600c52600c1c6000526034600c205490565b918215610bbe57610b75927f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff869260ff1b911617919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff6040519216825260208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576020610c186004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461023257604060031936011261023257610019600435610c40816102e4565b60243590611f47565b600319604091011261023257600435610c61816102e4565b90602435610c6e816102e4565b90565b34610232576020610acd610c8436610c49565b906122aa565b3461023257602060031936011261023257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610232576000600319360112610232576020600454604051908152f35b34610232576000600319360112610232576020600254604051908152f35b34610232576040600319360112610232576020610c18602435610d52816102e4565b6004359060205263739094b1600c52600c1c6000526034600c205490565b3461023257610d7e36610c49565b6000903d15610da9575b60208273ffffffffffffffffffffffffffffffffffffffff60405191168152f35b60205263739094b1600c525260206034600c2054605f1c38610d88565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051b01011161023257565b346102325760206003193601126102325760043567ffffffffffffffff811161023257610e2b610019913690600401610dc6565b90611d29565b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102325760a06003193601126102325760043560843560ff8116810361023257610e8e611647565b610ea2826000526005602052604060002090565b80549069ffffffffffffffffffff821691821561118057600582019081544311611156576110f784610fed936002611111966110347f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede89a610fc76040516020810190610fb781610f8b8d8c73ffffffffffffffffffffffffffffffffffffffff6024359260501c1687917fffffffffffffffffffff00000000000000000000000000000000000000000000907fffffffffffffffffffffffffffffffffffffffff000000000000000000000000603e959360601b16845260b01b166014830152601e8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610266565b5190209160643560443584611bae565b6000611006610fed600186015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b84547fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000168555955560019055565b0193611057610fed865473ffffffffffffffffffffffffffffffffffffffff1690565b331461112c57697fffffffffffffffffff9060011c1661108433600c1b6000526006602052604060002090565b61108f82825461163a565b90556110d66110ce6110be6110b8885473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526006602052604060002090565b91825461163a565b90555b835473ffffffffffffffffffffffffffffffffffffffff1690611c9c565b5473ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600355565b5061114433600c1b6000526006602052604060002090565b61114f83825461163a565b90556110d9565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610c6e928181520190610829565b346102325760406003193601126102325760043567ffffffffffffffff8111610232576111ec903690600401610302565b602435906111f9826102e4565b600091815191611208836122ff565b935b83811061121f576040518061097387826111aa565b8061124c8473ffffffffffffffffffffffffffffffffffffffff6112456001958761234e565b5116612273565b611256828861234e565b520161120a565b34610232576020610c1861127036610c49565b90612273565b346102325760406003193601126102325767ffffffffffffffff600435818111610232576112a8903690600401610302565b9060243590811161023257366023820112156102325780600401356112cc816102cc565b916112da6040519384610266565b81835260209160248385019160051b8301019136831161023257602401905b82821061130a576100198587611541565b83809161131684610538565b8152019101906112f9565b346102325760a06003193601126102325760043561133e816102e4565b6024359061134b826102e4565b6044359169ffffffffffffffffffff831683036102325767ffffffffffffffff9160643583811161023257611384903690600401610dc6565b9060843594851161023257610973956113a46113ac963690600401610dc6565b959094611793565b6040519081529081906020820190565b34610232576020600319360112610232576004356113d9816102e4565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361046d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360015560405191168152a1005b3461023257606060031936011261023257600435611449816102e4565b60243560443567ffffffffffffffff8111610232577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916114a2611494611529933690600401610dc6565b9061149d611647565b611d29565b6114ac84336122aa565b611533575b6114ed33600c1b85836b3fffffffffffffffffffffff6114e783859060205263739094b1600c52600c1c6000526034600c205490565b16612237565b6114f8813386611c9c565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600355005b61153c846116db565b6114b1565b9060009073ffffffffffffffffffffffffffffffffffffffff825416330361046d5782519182156115eb57815183036115de57602092919284818080970195019360051b0101925b838103611597575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191611589565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b906001820180921161163557565b6115f8565b9190820180921161163557565b600260035414611658576002600355565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d156001600051141716156116cd576000606052604052565b637939f4246000526004601cfd5b33600c1b6116ff82829060205263739094b1600c52600c1c6000526034600c205490565b908115610bbe57827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117489316919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b956117b89073ffffffffffffffffffffffffffffffffffffffff93949661149d611647565b16916117c76105d584876122aa565b611a60576117d58386612273565b9469ffffffffffffffffffff9182841691828810611a3657600c1b956117fc600454611627565b936005611813866000526005602052604060002090565b0154431115611a0c5761185b61183f888a9060205263739094b1600c52600c1c6000526034600c205490565b605f1c73ffffffffffffffffffffffffffffffffffffffff1690565b6118a561186a6002544361163a565b916118886118766102ac565b69ffffffffffffffffffff909a168a52565b73ffffffffffffffffffffffffffffffffffffffff166020890152565b73ffffffffffffffffffffffffffffffffffffffff881660408801523360608801526080870189905260a0870186905260c0870152821561191f5750611912979161190d9133916119078a6374dfee70600c52600c1c60005260206000205490565b91611aa7565b611fe2565b9061191d6001600355565b565b80925068056bc75e2d631000009150611942865169ffffffffffffffffffff1690565b1611611957575061195295611fe2565b611912565b61198861198361197433600c1b6000526006602052604060002090565b54670de0b6b3a7640000900490565b611b35565b816119a66119a0875169ffffffffffffffffffff1690565b92611a8a565b9116119081156119e9575b506119bf5761195295611fe2565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b845169d3c21bcecceda1000000925069ffffffffffffffffffff161611386119b1565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a76400009182810292818404149015171561163557565b73ffffffffffffffffffffffffffffffffffffffff8293941692611af9575b505003611acf57565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611b2a579290611b03565b509150503880611ac6565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102a7576020926000926040525190600154617530fa906000519115611ba057565b63e10bf1cc6000526004601cfd5b918254611c725760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611c65576060526040829052600c1b5415611c3d5750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611cd857603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015611d245760051b0190565b611ce5565b6000905b828210611d4a575010611d3c57565b63dfb035c96000526004601cfd5b90611d6a611d59828585611d14565b356000526005602052604060002090565b90611d7482611f96565b6003820154600192611d9f610fed8583015473ffffffffffffffffffffffffffffffffffffffff1690565b906b3fffffffffffffffffffffff611dcd83859060205263739094b1600c52600c1c6000526034600c205490565b16926a52b7d2dcc80cd2e4000000611e0b611e04611df5855469ffffffffffffffffffff1690565b69ffffffffffffffffffff1690565b809661163a565b116106f857611ed693600293611e3a929060205263739094b1600c52600c1c6000526034600c20908154019055565b80547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016815501611e826110b8825473ffffffffffffffffffffffffffffffffffffffff1690565b611ea0611e99826000526006602052604060002090565b5460011c90565b68056bc75e2d631000008111611f2c5750611ec86110f7916000526006602052604060002090565b68056bc75e2d631000009055565b7f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da573ffffffffffffffffffffffffffffffffffffffff611f17848888611d14565b60405190358152921691602090a20190611d2d565b90611f41906000526006602052604060002090565b556110f7565b338103611f88576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60058101544310611a0c575469ffffffffffffffffffff161561118057565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116355760010190565b9594906121c073ffffffffffffffffffffffffffffffffffffffff927f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949687600052600560205260406000209361207869ffffffffffffffffffff895116869069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60208801517fffff0000000000000000000000000000000000000000ffffffffffffffffffff7dffffffffffffffffffffffffffffffffffffffff0000000000000000000087549260501b1691161785556121316120ed60408a015173ffffffffffffffffffffffffffffffffffffffff1690565b600187019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b606088019a61219b6121578d5173ffffffffffffffffffffffffffffffffffffffff1690565b600288019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b60808901958651600382015560a08a01516004820155600560c08b0151910155612237565b6121d36121ce600454611fb5565b600455565b61223261220b6121f887995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176122655760205263739094b1600c52600c1c6000526034600c20908154039055565b63ce3a3d376000526004601cfd5b600092913d15612281575050565b9091925060205263739094b1600c526000526034600c20546b3fffffffffffffffffffffff1690565b600092913d156122b8575050565b9091925060205263739094b1600c526000526034600c205460ff1c90565b6040516020810181811067ffffffffffffffff8211176102a75760405260008152906000368137565b90612309826102cc565b6123166040519182610266565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061234482946102cc565b0190602036910137565b8051821015611d245760209160051b010190565b908151156124b3576000809280519061237a826122ff565b92612384836122ff565b955b83811061239557505050509190565b8060036123b86123a76001948761234e565b516000526005602052604060002090565b01546123e9576123c8818561234e565b516123d3828861234e565b52826123df828a61234e565b5201925b92612386565b69ffffffffffffffffffff6124146124046123a7848861234e565b5469ffffffffffffffffffff1690565b1661244957612423818561234e565b5161242e828861234e565b5261244261243c828a61234e565b60039052565b01926123e3565b60056124586123a7838761234e565b015443111561248a5761246b818561234e565b51612476828861234e565b52612442612484828a61234e565b60029052565b612494818561234e565b5161249f828861234e565b526124426124ad828a61234e565b60019052565b90506124bd6122d6565b90610c6e6122d656fea2646970667358221220216bb367f4639b3049c82d8c672f33139a235b727196b97dde2a622dee39d79b64736f6c63430008130033", - "deployedBytecode": "0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc578063328a7181146101f7578063367821f0146101f2578063461f3120146101ac57806349ef8448146101ed5780634b2ae980146101e8578063574983c8146101e35780635fd8c710146101de57806369cc6af4146101d95780636d82d9e0146101d457806377cd38a4146101cf5780637f94f65d146101ca57806380e1d302146101c557806384ab1d28146101c05780638da5cb5b146101bb5780638db564c2146101b65780639872dbfe146101b157806398a26871146101ac5780639eee8d4b146101a7578063ad8f2eed146101a2578063b0983d391461019d578063c52164c614610198578063c593dfd814610193578063d1c070281461018e578063d4fac45d14610189578063d6e8b97314610184578063dc43221c1461017f578063f7d0e04b1461017a5763fb8c5ef00361000e5761142c565b6113bc565b611321565b611276565b61125d565b6111bb565b610e65565b610e31565b610df7565b610d70565b610d30565b610808565b610d12565b610cf4565b610cc0565b610c8a565b610c71565b610c20565b610be8565b610ad7565b610a97565b610a14565b6109b0565b610986565b6108eb565b610776565b610545565b610497565b61036a565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b6040519060e0820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f8201121561023257803591610319836102cc565b926103276040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610351575050505090565b838091833561035f816102e4565b815201910190610343565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039c903690600401610302565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046d57805181830192849160051b830181013d1515855b8115610439575b50505060405192818401908285525180915260408401949160005b828110610423577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f4565b90838260018298969499979951600c1b550190838210156104615791509593959492946103d2565b509593959492946103d9565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b4816102e4565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361023257565b3590811515820361023257565b346102325760a060031936011261023257600435610562816102e4565b6024356bffffffffffffffffffffffff8116908181036102325760443590610589826102e4565b610591610529565b6084359373ffffffffffffffffffffffffffffffffffffffff8087169033600c1b9086161561074c576105d96105d58363cbc9d1c4600c526000526020600c205490565b1590565b610722576b3fffffffffffffffffffffff61060a83839060205263739094b1600c52600c1c6000526034600c205490565b16906a52b7d2dcc80cd2e4000000610622858461163a565b116106f857826106e39761069c9661066e89610693967f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf9d610662611647565b806106e8575b5061163a565b9060ff1b91605f1b1717919060205263739094b1600c52600c1c6000526034600c2055565b30903390611682565b6106a66001600355565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2005b6106f29033611f47565b38610668565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b3461023257602060031936011261023257600435600052600560205260e0604060002080549073ffffffffffffffffffffffffffffffffffffffff90816001820154168260028301541660038301549160056004850154940154946040519669ffffffffffffffffffff8116885260501c16602087015260408601526060850152608084015260a083015260c0820152f35b34610232576020600319360112610232576020600435546040519015158152f35b90815180825260208080930193019160005b828110610849575050505090565b83518552938101939281019260010161083b565b9061087090604083526040830190610829565b81810360209283015282518082529082019282019160009190825b82811061089a57505050505090565b909192939485516004808210156108bf5750815282019482019392919060010161088b565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610232576020806003193601126102325760043567ffffffffffffffff8111610232573660238201121561023257806004013590610929826102cc565b916109376040519384610266565b80835260248484019160051b8301019136831161023257602401905b8282106109775761096384612362565b906109736040519283928361085d565b0390f35b81358152908401908401610953565b346102325760206003193601126102325760206004356109a5816102e4565b60405190600c1b8152f35b346102325760206003193601126102325760043573ffffffffffffffffffffffffffffffffffffffff60005416330361046d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600255604051908152a1005b3461023257600080600319360112610a945773ffffffffffffffffffffffffffffffffffffffff815416330361046d57478180808084335af115610a87576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b34610232576020600319360112610232576020610acd600435610ab9816102e4565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3461023257604060031936011261023257600435610af4816102e4565b602435801515908181036102325733600c1b610b2684829060205263739094b1600c52600c1c6000526034600c205490565b918215610bbe57610b75927f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff869260ff1b911617919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff6040519216825260208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576020610c186004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461023257604060031936011261023257610019600435610c40816102e4565b60243590611f47565b600319604091011261023257600435610c61816102e4565b90602435610c6e816102e4565b90565b34610232576020610acd610c8436610c49565b906122aa565b3461023257602060031936011261023257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610232576000600319360112610232576020600454604051908152f35b34610232576000600319360112610232576020600254604051908152f35b34610232576040600319360112610232576020610c18602435610d52816102e4565b6004359060205263739094b1600c52600c1c6000526034600c205490565b3461023257610d7e36610c49565b6000903d15610da9575b60208273ffffffffffffffffffffffffffffffffffffffff60405191168152f35b60205263739094b1600c525260206034600c2054605f1c38610d88565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051b01011161023257565b346102325760206003193601126102325760043567ffffffffffffffff811161023257610e2b610019913690600401610dc6565b90611d29565b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102325760a06003193601126102325760043560843560ff8116810361023257610e8e611647565b610ea2826000526005602052604060002090565b80549069ffffffffffffffffffff821691821561118057600582019081544311611156576110f784610fed936002611111966110347f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede89a610fc76040516020810190610fb781610f8b8d8c73ffffffffffffffffffffffffffffffffffffffff6024359260501c1687917fffffffffffffffffffff00000000000000000000000000000000000000000000907fffffffffffffffffffffffffffffffffffffffff000000000000000000000000603e959360601b16845260b01b166014830152601e8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610266565b5190209160643560443584611bae565b6000611006610fed600186015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b84547fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000168555955560019055565b0193611057610fed865473ffffffffffffffffffffffffffffffffffffffff1690565b331461112c57697fffffffffffffffffff9060011c1661108433600c1b6000526006602052604060002090565b61108f82825461163a565b90556110d66110ce6110be6110b8885473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526006602052604060002090565b91825461163a565b90555b835473ffffffffffffffffffffffffffffffffffffffff1690611c9c565b5473ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600355565b5061114433600c1b6000526006602052604060002090565b61114f83825461163a565b90556110d9565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610c6e928181520190610829565b346102325760406003193601126102325760043567ffffffffffffffff8111610232576111ec903690600401610302565b602435906111f9826102e4565b600091815191611208836122ff565b935b83811061121f576040518061097387826111aa565b8061124c8473ffffffffffffffffffffffffffffffffffffffff6112456001958761234e565b5116612273565b611256828861234e565b520161120a565b34610232576020610c1861127036610c49565b90612273565b346102325760406003193601126102325767ffffffffffffffff600435818111610232576112a8903690600401610302565b9060243590811161023257366023820112156102325780600401356112cc816102cc565b916112da6040519384610266565b81835260209160248385019160051b8301019136831161023257602401905b82821061130a576100198587611541565b83809161131684610538565b8152019101906112f9565b346102325760a06003193601126102325760043561133e816102e4565b6024359061134b826102e4565b6044359169ffffffffffffffffffff831683036102325767ffffffffffffffff9160643583811161023257611384903690600401610dc6565b9060843594851161023257610973956113a46113ac963690600401610dc6565b959094611793565b6040519081529081906020820190565b34610232576020600319360112610232576004356113d9816102e4565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361046d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360015560405191168152a1005b3461023257606060031936011261023257600435611449816102e4565b60243560443567ffffffffffffffff8111610232577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916114a2611494611529933690600401610dc6565b9061149d611647565b611d29565b6114ac84336122aa565b611533575b6114ed33600c1b85836b3fffffffffffffffffffffff6114e783859060205263739094b1600c52600c1c6000526034600c205490565b16612237565b6114f8813386611c9c565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600355005b61153c846116db565b6114b1565b9060009073ffffffffffffffffffffffffffffffffffffffff825416330361046d5782519182156115eb57815183036115de57602092919284818080970195019360051b0101925b838103611597575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191611589565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b906001820180921161163557565b6115f8565b9190820180921161163557565b600260035414611658576002600355565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d156001600051141716156116cd576000606052604052565b637939f4246000526004601cfd5b33600c1b6116ff82829060205263739094b1600c52600c1c6000526034600c205490565b908115610bbe57827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117489316919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b956117b89073ffffffffffffffffffffffffffffffffffffffff93949661149d611647565b16916117c76105d584876122aa565b611a60576117d58386612273565b9469ffffffffffffffffffff9182841691828810611a3657600c1b956117fc600454611627565b936005611813866000526005602052604060002090565b0154431115611a0c5761185b61183f888a9060205263739094b1600c52600c1c6000526034600c205490565b605f1c73ffffffffffffffffffffffffffffffffffffffff1690565b6118a561186a6002544361163a565b916118886118766102ac565b69ffffffffffffffffffff909a168a52565b73ffffffffffffffffffffffffffffffffffffffff166020890152565b73ffffffffffffffffffffffffffffffffffffffff881660408801523360608801526080870189905260a0870186905260c0870152821561191f5750611912979161190d9133916119078a6374dfee70600c52600c1c60005260206000205490565b91611aa7565b611fe2565b9061191d6001600355565b565b80925068056bc75e2d631000009150611942865169ffffffffffffffffffff1690565b1611611957575061195295611fe2565b611912565b61198861198361197433600c1b6000526006602052604060002090565b54670de0b6b3a7640000900490565b611b35565b816119a66119a0875169ffffffffffffffffffff1690565b92611a8a565b9116119081156119e9575b506119bf5761195295611fe2565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b845169d3c21bcecceda1000000925069ffffffffffffffffffff161611386119b1565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a76400009182810292818404149015171561163557565b73ffffffffffffffffffffffffffffffffffffffff8293941692611af9575b505003611acf57565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611b2a579290611b03565b509150503880611ac6565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102a7576020926000926040525190600154617530fa906000519115611ba057565b63e10bf1cc6000526004601cfd5b918254611c725760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611c65576060526040829052600c1b5415611c3d5750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611cd857603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015611d245760051b0190565b611ce5565b6000905b828210611d4a575010611d3c57565b63dfb035c96000526004601cfd5b90611d6a611d59828585611d14565b356000526005602052604060002090565b90611d7482611f96565b6003820154600192611d9f610fed8583015473ffffffffffffffffffffffffffffffffffffffff1690565b906b3fffffffffffffffffffffff611dcd83859060205263739094b1600c52600c1c6000526034600c205490565b16926a52b7d2dcc80cd2e4000000611e0b611e04611df5855469ffffffffffffffffffff1690565b69ffffffffffffffffffff1690565b809661163a565b116106f857611ed693600293611e3a929060205263739094b1600c52600c1c6000526034600c20908154019055565b80547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016815501611e826110b8825473ffffffffffffffffffffffffffffffffffffffff1690565b611ea0611e99826000526006602052604060002090565b5460011c90565b68056bc75e2d631000008111611f2c5750611ec86110f7916000526006602052604060002090565b68056bc75e2d631000009055565b7f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da573ffffffffffffffffffffffffffffffffffffffff611f17848888611d14565b60405190358152921691602090a20190611d2d565b90611f41906000526006602052604060002090565b556110f7565b338103611f88576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60058101544310611a0c575469ffffffffffffffffffff161561118057565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116355760010190565b9594906121c073ffffffffffffffffffffffffffffffffffffffff927f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949687600052600560205260406000209361207869ffffffffffffffffffff895116869069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60208801517fffff0000000000000000000000000000000000000000ffffffffffffffffffff7dffffffffffffffffffffffffffffffffffffffff0000000000000000000087549260501b1691161785556121316120ed60408a015173ffffffffffffffffffffffffffffffffffffffff1690565b600187019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b606088019a61219b6121578d5173ffffffffffffffffffffffffffffffffffffffff1690565b600288019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b60808901958651600382015560a08a01516004820155600560c08b0151910155612237565b6121d36121ce600454611fb5565b600455565b61223261220b6121f887995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176122655760205263739094b1600c52600c1c6000526034600c20908154039055565b63ce3a3d376000526004601cfd5b600092913d15612281575050565b9091925060205263739094b1600c526000526034600c20546b3fffffffffffffffffffffff1690565b600092913d156122b8575050565b9091925060205263739094b1600c526000526034600c205460ff1c90565b6040516020810181811067ffffffffffffffff8211176102a75760405260008152906000368137565b90612309826102cc565b6123166040519182610266565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061234482946102cc565b0190602036910137565b8051821015611d245760209160051b010190565b908151156124b3576000809280519061237a826122ff565b92612384836122ff565b955b83811061239557505050509190565b8060036123b86123a76001948761234e565b516000526005602052604060002090565b01546123e9576123c8818561234e565b516123d3828861234e565b52826123df828a61234e565b5201925b92612386565b69ffffffffffffffffffff6124146124046123a7848861234e565b5469ffffffffffffffffffff1690565b1661244957612423818561234e565b5161242e828861234e565b5261244261243c828a61234e565b60039052565b01926123e3565b60056124586123a7838761234e565b015443111561248a5761246b818561234e565b51612476828861234e565b52612442612484828a61234e565b60029052565b612494818561234e565b5161249f828861234e565b526124426124ad828a61234e565b60019052565b90506124bd6122d6565b90610c6e6122d656fea2646970667358221220216bb367f4639b3049c82d8c672f33139a235b727196b97dde2a622dee39d79b64736f6c63430008130033", + "bytecode": "0x608060405262002c0a80380380620000178162000126565b928339810160a0828203126200010b5781516020808401519093916001600160401b03918281116200010b5784620000519185016200017f565b9062000060604085016200016a565b9260608501518181116200010b57866200007c9187016200017f565b9460808101519182116200010b57019480601f870112156200010b578551620000af620000a98262000152565b62000126565b96888089848152019260051b8201019283116200010b578801905b828210620000f157505050620000e19550620001e6565b6040516127c89081620004428239f35b815180151581036200010b578152908801908801620000ca565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176200014c57604052565b62000110565b6001600160401b0381116200014c5760051b60200190565b51906001600160a01b03821682036200010b57565b9080601f830112156200010b578151906200019e620000a98362000152565b9182938184526020808095019260051b8201019283116200010b578301905b828210620001cc575050505090565b838091620001da846200016a565b815201910190620001bd565b600080546001600160a01b031916339081178255929695949392817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3816003556040519182527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208093a18651878301979060051b810183013d1515895b811562000306575b5050506040519280840191818552518092526040840198925b828110620002e85750505050907f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d782620002d593620002db97980390a16001600160a01b031662000337565b62000390565b620002e66001600455565b565b83516001600160a01b03168a52988101989281019260010162000289565b9085826001829697989451600c1b550190838210156200032c5791509493929462000268565b509493929462000270565b6000546001600160a01b0390811633036200037f57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360025560405191168152a1565b6040516282b42960e81b8152600490fd5b60008054919290916001600160a01b031633036200037f5782519182156200043457815183036200042757602092919284818080970195019360051b0101925b838103620003df575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003d0565b63ff633a3890526004601cfd5b63df95788390526004601cfdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102365780630d2a2d441461023157806313af40351461022c578063367821f014610227578063461f3120146101d757806349ef8448146102225780634b2ae9801461021d578063572b6c0514610218578063574983c8146102135780635fd8c7101461020e57806369cc6af4146102095780636d82d9e01461020457806377cd38a4146101ff5780637f94f65d146101fa57806380e1d302146101f557806384ab1d28146101f05780638da5cb5b146101eb5780638db564c2146101e6578063918dff57146101e15780639872dbfe146101dc57806398a26871146101d75780639b6d694d146101d2578063ad8f2eed146101cd578063b0983d39146101c8578063c52164c6146101c3578063c593dfd8146101be578063d1c07028146101b9578063d1ced2b0146101b4578063d4fac45d146101af578063d6e8b973146101aa578063dc43221c146101a5578063e449c52a146101a0578063f7d0e04b1461019b5763fb8c5ef00361000e57611532565b6114c2565b611487565b6113ec565b61133a565b611321565b611272565b61112c565b610dfb565b610dc7565b610d8d565b610d49565b610cd9565b6105eb565b610c46565b610bbb565b610b7a565b610b46565b610b10565b610af7565b610aa6565b610a6e565b610917565b6108ca565b610847565b6107e3565b610793565b610769565b6106ce565b610559565b6104c7565b61039a565b346102625760206003193601126102625760043560005260076020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102d757604052565b610267565b6040519060e0820182811067ffffffffffffffff8211176102d757604052565b67ffffffffffffffff81116102d75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361026257565b81601f8201121561026257803591610349836102fc565b926103576040519485610296565b808452602092838086019260051b820101928311610262578301905b828210610381575050505090565b838091833561038f81610314565b815201910190610373565b34610262576020806003193601126102625760043567ffffffffffffffff8111610262576103cc903690600401610332565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361049d57805181830192849160051b830181013d1515855b8115610469575b50505060405192818401908285525180915260408401949160005b828110610453577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610424565b90838260018298969499979951600c1b55019083821015610491579150959395949294610402565b50959395949294610409565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576004356104e481610314565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361049d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b3461026257602060031936011261026257600435600052600660205260e060406000208054906005600182015491600281015460038201549060048301549273ffffffffffffffffffffffffffffffffffffffff9485910154169460405196875260208701526040860152606085015269ffffffffffffffffffff8116608085015260501c1660a083015260c0820152f35b34610262576020600319360112610262576020600435546040519015158152f35b90815180825260208080930193019160005b82811061062c575050505090565b83518552938101939281019260010161061e565b906106539060408352604083019061060c565b81810360209283015282518082529082019282019160009190825b82811061067d57505050505090565b909192939485516004808210156106a25750815282019482019392919060010161066e565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610262576020806003193601126102625760043567ffffffffffffffff811161026257366023820112156102625780600401359061070c826102fc565b9161071a6040519384610296565b80835260248484019160051b8301019136831161026257602401905b82821061075a576107468461262e565b9061075660405192839283610640565b0390f35b81358152908401908401610736565b3461026257602060031936011261026257602060043561078881610314565b60405190600c1b8152f35b346102625760206003193601126102625773ffffffffffffffffffffffffffffffffffffffff6004356107c581610314565b166000526001602052602060ff604060002054166040519015158152f35b346102625760206003193601126102625760043573ffffffffffffffffffffffffffffffffffffffff60005416330361049d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600355604051908152a1005b34610262576000806003193601126108c75773ffffffffffffffffffffffffffffffffffffffff815416330361049d57478180808084335af1156108ba576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b346102625760206003193601126102625760206109006004356108ec81610314565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3590811515820361026257565b346102625760406003193601126102625760043561093481610314565b602435801515810361026257602082905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44577fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4991610a3f918460205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000526b3fffffffffffffffffffffff82605f1b91161760016034600c20015560405191829173ffffffffffffffffffffffffffffffffffffffff3396168390929160209073ffffffffffffffffffffffffffffffffffffffff60408401951683521515910152565b0390a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576020610a9e6004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461026257604060031936011261026257610019600435610ac681610314565b60243590612221565b600319604091011261026257600435610ae781610314565b90602435610af481610314565b90565b34610262576020610900610b0a36610acf565b9061253c565b3461026257602060031936011261026257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610262576000600319360112610262576020600554604051908152f35b60005b838110610bab5750506000910152565b8181015183820152602001610b9b565b3461026257610bd2610bcc36610acf565b90612579565b604051906020820190815260208252604082019180831067ffffffffffffffff8411176102d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60409385855260208652610c3d845180928160608801526080870190610b98565b01168101030190f35b34610262576000600319360112610262576020600354604051908152f35b81601f820112156102625780359067ffffffffffffffff82116102d75760405192610cb760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610296565b8284526020838301011161026257816000926020809301838601378301015290565b346102625760a060031936011261026257600435610cf681610314565b602435906bffffffffffffffffffffffff821682036102625760443567ffffffffffffffff811161026257610d2f903690600401610c64565b6064359081151582036102625761001993608435936116cf565b34610262576020610a9e610bcc36610acf565b9181601f840112156102625782359167ffffffffffffffff8311610262576020808501948460051b01011161026257565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610dc1610019913690600401610d5c565b90612023565b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b346102625760a06003193601126102625760043560843560ff8116810361026257610e246118c5565b610e38826000526006602052604060002090565b6004810180549169ffffffffffffffffffff83169283156110f15760028201805443116110c75784600584610f5d7f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8996000610fac96610f56610fdf9b610f2e89610ef2610f1e610fc69f6003015460405192839160208301956024359187917fffffffffffffffffffff0000000000000000000000000000000000000000000090604a9492845260b01b166020830152602a8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610296565b5190209560643560443588611ea8565b7fffffffffffffffffffffffffffffffffffffffffffff000000000000000000008154169055565b5560019055565b610f65611e33565b905015610ffa575b019273ffffffffffffffffffffffffffffffffffffffff610fa2855473ffffffffffffffffffffffffffffffffffffffff1690565b9160501c16611f96565b5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600455565b81810161101e610fc6825473ffffffffffffffffffffffffffffffffffffffff1690565b33146110a45761109d61109561108561107f697fffffffffffffffffff8a60011c169461105833600c1b6000526007602052604060002090565b6110638782546116c2565b90555473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526007602052604060002090565b9182546116c2565b9055610f6d565b506110bc33600c1b6000526007602052604060002090565b61109d8482546116c2565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610af492818152019061060c565b346102625760406003193601126102625760043567ffffffffffffffff81116102625761115d903690600401610332565b6024359061116a82610314565b600091815191611179836125cb565b935b8381106111905760405180610756878261111b565b806111bd8473ffffffffffffffffffffffffffffffffffffffff6111b66001958761261a565b5116612502565b6111c7828861261a565b520161117b565b9060406003198301126102625767ffffffffffffffff9160043583811161026257816111fc91600401610332565b92602435908111610262578160238201121561026257806004013591611221836102fc565b9261122f6040519485610296565b80845260209260248486019260051b82010192831161026257602401905b82821061125b575050505090565b8380916112678461090a565b81520191019061124d565b3461026257611280366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d57825190811561131f57805182036113125790602084818080970194019260051b0101915b8281036112d0578380f35b8480916001825280518652835180604088205581517fbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df928880a3019101906112c5565b63ff633a3883526004601cfd5bfe5b34610262576020610a9e61133436610acf565b90612502565b3461026257611348366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d5782519081156113df57805182036113125790602084818080970194019260051b0101915b828103611398578380f35b84809181600c63cbc9d1c48152825188528551918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8880a30191019061138d565b63df95788383526004601cfd5b346102625760a06003193601126102625760043561140981610314565b6024359061141682610314565b6044359169ffffffffffffffffffff831683036102625767ffffffffffffffff916064358381116102625761144f903690600401610d5c565b90608435948511610262576107569561146f611477963690600401610d5c565b959094611a2f565b6040519081529081906020820190565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610a9e6114bd6020923690600401610c64565b61164a565b34610262576020600319360112610262576004356114df81610314565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361049d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360025560405191168152a1005b346102625760606003193601126102625760043561154f81610314565b60243560443567ffffffffffffffff8111610262577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916115a861159a611632933690600401610d5c565b906115a36118c5565b612023565b6115b2843361253c565b61163c575b6115f633600c1b85836b3fffffffffffffffffffffff6115f083859060205263739094b1600c52600c1c60005260016034600c20015490565b166124c3565b611601813386611f96565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600455005b61164584611959565b6115b7565b604051611674602082816116678183019687815193849201610b98565b8101038084520182610296565b5160201061131f575190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116116bd57565b611680565b919082018092116116bd57565b939273ffffffffffffffffffffffffffffffffffffffff85169333600c1b9484511561189b576117146117108263cbc9d1c4600c526000526020600c205490565b1590565b611871576b3fffffffffffffffffffffff61174882889060205263739094b1600c52600c1c60005260016034600c20015490565b16916117636bffffffffffffffffffffffff861680946116c2565b936a52b7d2dcc80cd2e40000008511611847577f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf97836117eb966117bc6118329a6117e2966117b06118c5565b80611837575b5061164a565b93605f1b17919060205263739094b1600c52600c1c6000526034600c2090600182015555565b30903390611900565b6117f56001600455565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2565b6118419033612221565b386117b6565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b6002600454146118d6576002600455565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d1560016000511417161561194b576000606052604052565b637939f4246000526004601cfd5b602081905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44576b3fffffffffffffffffffffff908260205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000521660016034600c20015573ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b9295611a559073ffffffffffffffffffffffffffffffffffffffff9395966115a36118c5565b1691611a64611710848461253c565b611ce557611a728383612502565b9469ffffffffffffffffffff80831691828810611cbb5784600c1b96611a996005546116af565b946002611ab0876000526006602052604060002090565b0154431115611c9157611ac1611e33565b611ada8a611ad4600398949854436116c2565b9a612579565b611ae26102dc565b998c8b528960208c015260408b015260608a0152611b1060808a0193849069ffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8a1660a08a015273ffffffffffffffffffffffffffffffffffffffff861660c08a01528315611b8e5750505091611b7c91611b819993611b768a6374dfee70600c52600c1c60005260206000205490565b91611d2c565b6122bf565b90611b8c6001600455565b565b9250819450809350611bb468056bc75e2d63100000925169ffffffffffffffffffff1690565b1611611bcb57505050611bc6956122bf565b611b81565b15611bdb575050611bc6956122bf565b611c0c611c07611bf833600c1b6000526007602052604060002090565b54670de0b6b3a7640000900490565b611dba565b81611c2a611c24855169ffffffffffffffffffff1690565b92611d0f565b911611918215611c6e575b5050611c4457611bc6956122bf565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b5169d3c21bcecceda1000000925069ffffffffffffffffffff1616113880611c35565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a7640000918281029281840414901517156116bd57565b73ffffffffffffffffffffffffffffffffffffffff8293941692611d7e575b505003611d5457565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611daf579290611d88565b509150503880611d4b565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102d7576020926000926040525190600254617530fa906000519115611e2557565b63e10bf1cc6000526004601cfd5b611e3b611e61565b90600073ffffffffffffffffffffffffffffffffffffffff83163314610af45750600190565b33600052600160205260ff60406000205416600014611ea4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b3390565b918254611f6c5760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611f5f576060526040829052600c1b5415611f375750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611fd257603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b919081101561201e5760051b0190565b611fdf565b6000905b82821061204457501061203657565b63dfb035c96000526004601cfd5b9061206461205382858561200e565b356000526006602052604060002090565b61206d81612270565b80549060048082019081549073ffffffffffffffffffffffffffffffffffffffff94858360501c16916a52b7d2dcc80cd2e40000006120ea69ffffffffffffffffffff6b3fffffffffffffffffffffff6120e087879060205263739094b1600c52600c1c60005260016034600c20015490565b16961680966116c2565b116121f95750936121477f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da594610f2e6121bd9560059560019b9a999060205263739094b1600c52600c1c60005260016034600c2001908154019055565b0161216961107f825473ffffffffffffffffffffffffffffffffffffffff1690565b612187612180826000526007602052604060002090565b5460011c90565b68056bc75e2d6310000081116121de57506121af610fac916000526007602052604060002090565b68056bc75e2d631000009055565b916121c984888861200e565b60405190358152921691602090a20190612027565b906121f3906000526007602052604060002090565b55610fac565b6040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b338103612262576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60028101544310611c91576004015469ffffffffffffffffffff16156110f157565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116bd5760010190565b9261244c61240597967f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949673ffffffffffffffffffffffffffffffffffffffff94612358978960005260066020526124476040600020875181556020880151600182015560408801516002820155606088015160038201556123e36004820161238f60808b019d8e5169ffffffffffffffffffff1690565b829069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60a08a015181547fffff0000000000000000000000000000000000000000ffffffffffffffffffff1660509190911b7dffffffffffffffffffffffffffffffffffffffff0000000000000000000016179055565b600560c089019e8f5173ffffffffffffffffffffffffffffffffffffffff1690565b91019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b6124c3565b61245f61245a600554612292565b600555565b6124be61249761248487995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176124f45760205263739094b1600c52600c1c60005260016034600c2001908154039055565b63ce3a3d376000526004601cfd5b600092913d15612510575050565b9091925060205263739094b1600c5260005260016034600c2001546b3fffffffffffffffffffffff1690565b600092913d1561254a575050565b9091925060205263739094b1600c5260005260016034600c200154605f1c6b3fffffffffffffffffffffff1690565b600092913d15612587575050565b9091925060205263739094b1600c526000526034600c205490565b6040516020810181811067ffffffffffffffff8211176102d75760405260008152906000368137565b906125d5826102fc565b6125e26040519182610296565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061261082946102fc565b0190602036910137565b805182101561201e5760209160051b010190565b9081511561277f5760008092805190612646826125cb565b92612650836125cb565b955b83811061266157505050509190565b806126826126716001938661261a565b516000526006602052604060002090565b546126b257612691818561261a565b5161269c828861261a565b52826126a8828a61261a565b5201925b92612652565b69ffffffffffffffffffff6126e060046126cf612671858961261a565b015469ffffffffffffffffffff1690565b16612715576126ef818561261a565b516126fa828861261a565b5261270e612708828a61261a565b60039052565b01926126ac565b6002612724612671838761261a565b015443111561275657612737818561261a565b51612742828861261a565b5261270e612750828a61261a565b60029052565b612760818561261a565b5161276b828861261a565b5261270e612779828a61261a565b60019052565b90506127896125a2565b90610af46125a256fea26469706673582212209ffa8d03f81d9a82810b196ea8ca2756ed5c27b9f6548170be7b687163a33fe864736f6c63430008130033", + "deployedBytecode": "0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102365780630d2a2d441461023157806313af40351461022c578063367821f014610227578063461f3120146101d757806349ef8448146102225780634b2ae9801461021d578063572b6c0514610218578063574983c8146102135780635fd8c7101461020e57806369cc6af4146102095780636d82d9e01461020457806377cd38a4146101ff5780637f94f65d146101fa57806380e1d302146101f557806384ab1d28146101f05780638da5cb5b146101eb5780638db564c2146101e6578063918dff57146101e15780639872dbfe146101dc57806398a26871146101d75780639b6d694d146101d2578063ad8f2eed146101cd578063b0983d39146101c8578063c52164c6146101c3578063c593dfd8146101be578063d1c07028146101b9578063d1ced2b0146101b4578063d4fac45d146101af578063d6e8b973146101aa578063dc43221c146101a5578063e449c52a146101a0578063f7d0e04b1461019b5763fb8c5ef00361000e57611532565b6114c2565b611487565b6113ec565b61133a565b611321565b611272565b61112c565b610dfb565b610dc7565b610d8d565b610d49565b610cd9565b6105eb565b610c46565b610bbb565b610b7a565b610b46565b610b10565b610af7565b610aa6565b610a6e565b610917565b6108ca565b610847565b6107e3565b610793565b610769565b6106ce565b610559565b6104c7565b61039a565b346102625760206003193601126102625760043560005260076020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102d757604052565b610267565b6040519060e0820182811067ffffffffffffffff8211176102d757604052565b67ffffffffffffffff81116102d75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361026257565b81601f8201121561026257803591610349836102fc565b926103576040519485610296565b808452602092838086019260051b820101928311610262578301905b828210610381575050505090565b838091833561038f81610314565b815201910190610373565b34610262576020806003193601126102625760043567ffffffffffffffff8111610262576103cc903690600401610332565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361049d57805181830192849160051b830181013d1515855b8115610469575b50505060405192818401908285525180915260408401949160005b828110610453577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610424565b90838260018298969499979951600c1b55019083821015610491579150959395949294610402565b50959395949294610409565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576004356104e481610314565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361049d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b3461026257602060031936011261026257600435600052600660205260e060406000208054906005600182015491600281015460038201549060048301549273ffffffffffffffffffffffffffffffffffffffff9485910154169460405196875260208701526040860152606085015269ffffffffffffffffffff8116608085015260501c1660a083015260c0820152f35b34610262576020600319360112610262576020600435546040519015158152f35b90815180825260208080930193019160005b82811061062c575050505090565b83518552938101939281019260010161061e565b906106539060408352604083019061060c565b81810360209283015282518082529082019282019160009190825b82811061067d57505050505090565b909192939485516004808210156106a25750815282019482019392919060010161066e565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610262576020806003193601126102625760043567ffffffffffffffff811161026257366023820112156102625780600401359061070c826102fc565b9161071a6040519384610296565b80835260248484019160051b8301019136831161026257602401905b82821061075a576107468461262e565b9061075660405192839283610640565b0390f35b81358152908401908401610736565b3461026257602060031936011261026257602060043561078881610314565b60405190600c1b8152f35b346102625760206003193601126102625773ffffffffffffffffffffffffffffffffffffffff6004356107c581610314565b166000526001602052602060ff604060002054166040519015158152f35b346102625760206003193601126102625760043573ffffffffffffffffffffffffffffffffffffffff60005416330361049d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600355604051908152a1005b34610262576000806003193601126108c75773ffffffffffffffffffffffffffffffffffffffff815416330361049d57478180808084335af1156108ba576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b346102625760206003193601126102625760206109006004356108ec81610314565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3590811515820361026257565b346102625760406003193601126102625760043561093481610314565b602435801515810361026257602082905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44577fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4991610a3f918460205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000526b3fffffffffffffffffffffff82605f1b91161760016034600c20015560405191829173ffffffffffffffffffffffffffffffffffffffff3396168390929160209073ffffffffffffffffffffffffffffffffffffffff60408401951683521515910152565b0390a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576020610a9e6004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461026257604060031936011261026257610019600435610ac681610314565b60243590612221565b600319604091011261026257600435610ae781610314565b90602435610af481610314565b90565b34610262576020610900610b0a36610acf565b9061253c565b3461026257602060031936011261026257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610262576000600319360112610262576020600554604051908152f35b60005b838110610bab5750506000910152565b8181015183820152602001610b9b565b3461026257610bd2610bcc36610acf565b90612579565b604051906020820190815260208252604082019180831067ffffffffffffffff8411176102d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60409385855260208652610c3d845180928160608801526080870190610b98565b01168101030190f35b34610262576000600319360112610262576020600354604051908152f35b81601f820112156102625780359067ffffffffffffffff82116102d75760405192610cb760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610296565b8284526020838301011161026257816000926020809301838601378301015290565b346102625760a060031936011261026257600435610cf681610314565b602435906bffffffffffffffffffffffff821682036102625760443567ffffffffffffffff811161026257610d2f903690600401610c64565b6064359081151582036102625761001993608435936116cf565b34610262576020610a9e610bcc36610acf565b9181601f840112156102625782359167ffffffffffffffff8311610262576020808501948460051b01011161026257565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610dc1610019913690600401610d5c565b90612023565b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b346102625760a06003193601126102625760043560843560ff8116810361026257610e246118c5565b610e38826000526006602052604060002090565b6004810180549169ffffffffffffffffffff83169283156110f15760028201805443116110c75784600584610f5d7f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8996000610fac96610f56610fdf9b610f2e89610ef2610f1e610fc69f6003015460405192839160208301956024359187917fffffffffffffffffffff0000000000000000000000000000000000000000000090604a9492845260b01b166020830152602a8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610296565b5190209560643560443588611ea8565b7fffffffffffffffffffffffffffffffffffffffffffff000000000000000000008154169055565b5560019055565b610f65611e33565b905015610ffa575b019273ffffffffffffffffffffffffffffffffffffffff610fa2855473ffffffffffffffffffffffffffffffffffffffff1690565b9160501c16611f96565b5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600455565b81810161101e610fc6825473ffffffffffffffffffffffffffffffffffffffff1690565b33146110a45761109d61109561108561107f697fffffffffffffffffff8a60011c169461105833600c1b6000526007602052604060002090565b6110638782546116c2565b90555473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526007602052604060002090565b9182546116c2565b9055610f6d565b506110bc33600c1b6000526007602052604060002090565b61109d8482546116c2565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610af492818152019061060c565b346102625760406003193601126102625760043567ffffffffffffffff81116102625761115d903690600401610332565b6024359061116a82610314565b600091815191611179836125cb565b935b8381106111905760405180610756878261111b565b806111bd8473ffffffffffffffffffffffffffffffffffffffff6111b66001958761261a565b5116612502565b6111c7828861261a565b520161117b565b9060406003198301126102625767ffffffffffffffff9160043583811161026257816111fc91600401610332565b92602435908111610262578160238201121561026257806004013591611221836102fc565b9261122f6040519485610296565b80845260209260248486019260051b82010192831161026257602401905b82821061125b575050505090565b8380916112678461090a565b81520191019061124d565b3461026257611280366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d57825190811561131f57805182036113125790602084818080970194019260051b0101915b8281036112d0578380f35b8480916001825280518652835180604088205581517fbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df928880a3019101906112c5565b63ff633a3883526004601cfd5bfe5b34610262576020610a9e61133436610acf565b90612502565b3461026257611348366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d5782519081156113df57805182036113125790602084818080970194019260051b0101915b828103611398578380f35b84809181600c63cbc9d1c48152825188528551918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8880a30191019061138d565b63df95788383526004601cfd5b346102625760a06003193601126102625760043561140981610314565b6024359061141682610314565b6044359169ffffffffffffffffffff831683036102625767ffffffffffffffff916064358381116102625761144f903690600401610d5c565b90608435948511610262576107569561146f611477963690600401610d5c565b959094611a2f565b6040519081529081906020820190565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610a9e6114bd6020923690600401610c64565b61164a565b34610262576020600319360112610262576004356114df81610314565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361049d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360025560405191168152a1005b346102625760606003193601126102625760043561154f81610314565b60243560443567ffffffffffffffff8111610262577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916115a861159a611632933690600401610d5c565b906115a36118c5565b612023565b6115b2843361253c565b61163c575b6115f633600c1b85836b3fffffffffffffffffffffff6115f083859060205263739094b1600c52600c1c60005260016034600c20015490565b166124c3565b611601813386611f96565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600455005b61164584611959565b6115b7565b604051611674602082816116678183019687815193849201610b98565b8101038084520182610296565b5160201061131f575190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116116bd57565b611680565b919082018092116116bd57565b939273ffffffffffffffffffffffffffffffffffffffff85169333600c1b9484511561189b576117146117108263cbc9d1c4600c526000526020600c205490565b1590565b611871576b3fffffffffffffffffffffff61174882889060205263739094b1600c52600c1c60005260016034600c20015490565b16916117636bffffffffffffffffffffffff861680946116c2565b936a52b7d2dcc80cd2e40000008511611847577f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf97836117eb966117bc6118329a6117e2966117b06118c5565b80611837575b5061164a565b93605f1b17919060205263739094b1600c52600c1c6000526034600c2090600182015555565b30903390611900565b6117f56001600455565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2565b6118419033612221565b386117b6565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b6002600454146118d6576002600455565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d1560016000511417161561194b576000606052604052565b637939f4246000526004601cfd5b602081905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44576b3fffffffffffffffffffffff908260205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000521660016034600c20015573ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b9295611a559073ffffffffffffffffffffffffffffffffffffffff9395966115a36118c5565b1691611a64611710848461253c565b611ce557611a728383612502565b9469ffffffffffffffffffff80831691828810611cbb5784600c1b96611a996005546116af565b946002611ab0876000526006602052604060002090565b0154431115611c9157611ac1611e33565b611ada8a611ad4600398949854436116c2565b9a612579565b611ae26102dc565b998c8b528960208c015260408b015260608a0152611b1060808a0193849069ffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8a1660a08a015273ffffffffffffffffffffffffffffffffffffffff861660c08a01528315611b8e5750505091611b7c91611b819993611b768a6374dfee70600c52600c1c60005260206000205490565b91611d2c565b6122bf565b90611b8c6001600455565b565b9250819450809350611bb468056bc75e2d63100000925169ffffffffffffffffffff1690565b1611611bcb57505050611bc6956122bf565b611b81565b15611bdb575050611bc6956122bf565b611c0c611c07611bf833600c1b6000526007602052604060002090565b54670de0b6b3a7640000900490565b611dba565b81611c2a611c24855169ffffffffffffffffffff1690565b92611d0f565b911611918215611c6e575b5050611c4457611bc6956122bf565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b5169d3c21bcecceda1000000925069ffffffffffffffffffff1616113880611c35565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a7640000918281029281840414901517156116bd57565b73ffffffffffffffffffffffffffffffffffffffff8293941692611d7e575b505003611d5457565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611daf579290611d88565b509150503880611d4b565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102d7576020926000926040525190600254617530fa906000519115611e2557565b63e10bf1cc6000526004601cfd5b611e3b611e61565b90600073ffffffffffffffffffffffffffffffffffffffff83163314610af45750600190565b33600052600160205260ff60406000205416600014611ea4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b3390565b918254611f6c5760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611f5f576060526040829052600c1b5415611f375750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611fd257603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b919081101561201e5760051b0190565b611fdf565b6000905b82821061204457501061203657565b63dfb035c96000526004601cfd5b9061206461205382858561200e565b356000526006602052604060002090565b61206d81612270565b80549060048082019081549073ffffffffffffffffffffffffffffffffffffffff94858360501c16916a52b7d2dcc80cd2e40000006120ea69ffffffffffffffffffff6b3fffffffffffffffffffffff6120e087879060205263739094b1600c52600c1c60005260016034600c20015490565b16961680966116c2565b116121f95750936121477f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da594610f2e6121bd9560059560019b9a999060205263739094b1600c52600c1c60005260016034600c2001908154019055565b0161216961107f825473ffffffffffffffffffffffffffffffffffffffff1690565b612187612180826000526007602052604060002090565b5460011c90565b68056bc75e2d6310000081116121de57506121af610fac916000526007602052604060002090565b68056bc75e2d631000009055565b916121c984888861200e565b60405190358152921691602090a20190612027565b906121f3906000526007602052604060002090565b55610fac565b6040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b338103612262576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60028101544310611c91576004015469ffffffffffffffffffff16156110f157565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116bd5760010190565b9261244c61240597967f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949673ffffffffffffffffffffffffffffffffffffffff94612358978960005260066020526124476040600020875181556020880151600182015560408801516002820155606088015160038201556123e36004820161238f60808b019d8e5169ffffffffffffffffffff1690565b829069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60a08a015181547fffff0000000000000000000000000000000000000000ffffffffffffffffffff1660509190911b7dffffffffffffffffffffffffffffffffffffffff0000000000000000000016179055565b600560c089019e8f5173ffffffffffffffffffffffffffffffffffffffff1690565b91019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b6124c3565b61245f61245a600554612292565b600555565b6124be61249761248487995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176124f45760205263739094b1600c52600c1c60005260016034600c2001908154039055565b63ce3a3d376000526004601cfd5b600092913d15612510575050565b9091925060205263739094b1600c5260005260016034600c2001546b3fffffffffffffffffffffff1690565b600092913d1561254a575050565b9091925060205263739094b1600c5260005260016034600c200154605f1c6b3fffffffffffffffffffffff1690565b600092913d15612587575050565b9091925060205263739094b1600c526000526034600c205490565b6040516020810181811067ffffffffffffffff8211176102d75760405260008152906000368137565b906125d5826102fc565b6125e26040519182610296565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061261082946102fc565b0190602036910137565b805182101561201e5760209160051b010190565b9081511561277f5760008092805190612646826125cb565b92612650836125cb565b955b83811061266157505050509190565b806126826126716001938661261a565b516000526006602052604060002090565b546126b257612691818561261a565b5161269c828861261a565b52826126a8828a61261a565b5201925b92612652565b69ffffffffffffffffffff6126e060046126cf612671858961261a565b015469ffffffffffffffffffff1690565b16612715576126ef818561261a565b516126fa828861261a565b5261270e612708828a61261a565b60039052565b01926126ac565b6002612724612671838761261a565b015443111561275657612737818561261a565b51612742828861261a565b5261270e612750828a61261a565b60029052565b612760818561261a565b5161276b828861261a565b5261270e612779828a61261a565b60019052565b90506127896125a2565b90610af46125a256fea26469706673582212209ffa8d03f81d9a82810b196ea8ca2756ed5c27b9f6548170be7b687163a33fe864736f6c63430008130033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/contracts/Reputation.sol b/contracts/Reputation.sol index ebf4096..888e1e0 100644 --- a/contracts/Reputation.sol +++ b/contracts/Reputation.sol @@ -12,7 +12,7 @@ contract Reputation is IReputation { // prettier-ignore // solhint-disable no-inline-assembly // solhint-disable-next-line no-empty-blocks - constructor(/* */) {/* */} + constructor(/* */) payable {/* */} function limiter( uint256 _userCredit diff --git a/contracts/core/BaseUtils.sol b/contracts/core/BaseUtils.sol index 30c3689..389e604 100644 --- a/contracts/core/BaseUtils.sol +++ b/contracts/core/BaseUtils.sol @@ -2,10 +2,15 @@ pragma solidity 0.8.19; import { OwnerSettings } from "./OwnerSettings.sol"; + import { ECDSA } from "../lib/utils/ECDSA.sol"; import { MerkleProofLib as Merkle } from "../lib/utils/MerkleProofLib.sol"; +import { ReentrancyGuard } from "../lib/utils/ReentrancyGuard.sol"; -abstract contract BaseUtils is OwnerSettings { +abstract contract BaseUtils is + OwnerSettings, + ReentrancyGuard +{ /// ███ Storage ████████████████████████████████████████████████████████████ /// @dev List of Pix transactions already signed. @@ -67,26 +72,26 @@ abstract contract BaseUtils is OwnerSettings { ) revert AddressDenied(); } - function _castToUint( - uint96 _amount, - uint160 _pixTarget, + function _castBool( bool _valid - ) - internal - pure - returns ( - uint256 _amountCasted, - uint256 _pixTargetCasted, - uint256 _validCasted - ) - { + ) internal pure returns (uint256 _validCasted) { assembly { - _amountCasted := _amount - _pixTargetCasted := _pixTarget _validCasted := _valid } } + function getStr( + string memory str + ) public pure returns (bytes32 strEnc) { + bytes memory enc = bytes(abi.encodePacked(str)); + assembly { + if lt(0x20, mload(enc)) { + invalid() + } + strEnc := mload(add(enc, 0x20)) + } + } + /// @notice Public method that handles `address` /// to `uint256` safe type casting. /// @dev Function sighash: 0x4b2ae980. diff --git a/contracts/core/Constants.sol b/contracts/core/Constants.sol index 85759f4..5022ccb 100644 --- a/contracts/core/Constants.sol +++ b/contracts/core/Constants.sol @@ -8,6 +8,8 @@ abstract contract Constants { 0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632; uint256 constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE = 0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a; + uint256 constant _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE = + 0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92; /// @dev Seller casted to key => Seller's allowlist merkleroot. /// mapping(uint256 => bytes32) public sellerAllowList; @@ -18,12 +20,12 @@ abstract contract Constants { /// @dev `balance` max. value = 10**26. /// @dev `pixTarget` keys are restricted to 160 bits. - /// mapping(uint256 => mapping(ERC20 => uint256)) public sellerBalance; + /// mapping(uint256 => mapping(ERC20 => { `uint256`, `uint96` } )) public sellerBalance; /// @dev Bits layout: + /// `bytes32` [0...255] := pixTarget /// `uint96` [0...94] := balance - /// `uint160` [95...254] := pixTarget - /// `bool` [255] := valid + /// `bool` [95] := valid /// @dev Value in custom storage slot given by: /// mstore(0x20, token) @@ -34,12 +36,10 @@ abstract contract Constants { /// @dev The bitmask of `sellerBalance` entry. uint256 constant BITMASK_SB_ENTRY = (1 << 94) - 1; - /// @dev The bit position of `pixTarget` in `sellerBalance`. - uint256 constant BITPOS_PIXTARGET = 95; /// @dev The bit position of `valid` in `sellerBalance`. - uint256 constant BITPOS_VALID = 255; + uint256 constant BITPOS_VALID = 95; /// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one. - uint256 constant BITMASK_VALID = (1 << 255) - 1; + // uint256 constant BITMASK_VALID = (1 << 255) - 1; /// @dev The scalar of BRZ token. uint256 constant WAD = 1e18; diff --git a/contracts/core/DataTypes.sol b/contracts/core/DataTypes.sol index 8db52ba..690ee3a 100644 --- a/contracts/core/DataTypes.sol +++ b/contracts/core/DataTypes.sol @@ -3,15 +3,13 @@ pragma solidity 0.8.19; library DataTypes { struct Lock { - uint80 amount; - uint160 pixTarget; - address token; - /// @dev Amount to be tranfered via PIX. - address buyerAddress; uint256 sellerKey; uint256 counter; - /// @dev If not paid at this block will be expired. uint256 expirationBlock; + bytes32 pixTarget; + uint80 amount; + address token; + address buyerAddress; } // prettier-ignore diff --git a/contracts/core/EventAndErrors.sol b/contracts/core/EventAndErrors.sol index 2f84431..6238d5e 100644 --- a/contracts/core/EventAndErrors.sol +++ b/contracts/core/EventAndErrors.sol @@ -57,6 +57,11 @@ interface EventAndErrors { address indexed token, bool indexed state ); + /// @dev 0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92 + event TrustedForwarderUpdated( + address indexed forwarder, + bool indexed state + ); /// @dev 0xe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f event ReputationUpdated(address reputation); /// @dev 0x70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511 @@ -64,6 +69,7 @@ interface EventAndErrors { /// @dev 0x14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7 event ValidSignersUpdated(address[] signers); + /// ███ Errors ████████████████████████████████████████████████████████████ /// @dev Only seller could call this function. diff --git a/contracts/core/OwnerSettings.sol b/contracts/core/OwnerSettings.sol index 6c44980..5cd8043 100644 --- a/contracts/core/OwnerSettings.sol +++ b/contracts/core/OwnerSettings.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; +import { ERC2771Context as ERC2771 } from "../lib/metatx/ERC2771Context.sol"; import { ERC20, SafeTransferLib } from "../lib/utils/SafeTransferLib.sol"; import { IReputation } from "../lib/interfaces/IReputation.sol"; import { EventAndErrors } from "./EventAndErrors.sol"; @@ -10,7 +11,8 @@ import { Owned } from "../lib/auth/Owned.sol"; abstract contract OwnerSettings is Constants, EventAndErrors, - Owned(msg.sender) + Owned(msg.sender), + ERC2771 { /// ███ Storage ████████████████████████████████████████████████████████████ @@ -40,6 +42,48 @@ abstract contract OwnerSettings is /// ███ Owner Only █████████████████████████████████████████████████████████ + function setTrustedFowarders( + address[] memory forwarders, + bool[] memory states + ) external onlyOwner { + assembly { + // first 32 bytes eq to array's length + let fLen := mload(forwarders) + // halts execution if forwarders.length eq 0 + if iszero(fLen) { + invalid() + } + // revert with `LengthMismatch()` + if iszero(eq(fLen, mload(states))) { + mstore(0x00, 0xff633a38) + revert(0x1c, 0x04) + } + let fLoc := add(forwarders, 0x20) + let sLoc := add(states, 0x20) + for { + let end := add(fLoc, shl(5, fLen)) + } iszero(eq(fLoc, end)) { + fLoc := add(fLoc, 0x20) + sLoc := add(sLoc, 0x20) + } { + // cache hashmap entry in scratch space + mstore(0x20, isTrustedForwarder.slot) + mstore(0x00, mload(fLoc)) + // let mapSlot := keccak256(0x00, 0x40) + sstore(keccak256(0x00, 0x40), mload(sLoc)) + + // emit TrustedForwarderUpdated(address, bool) + log3( + 0, + 0, + _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE, + mload(fLoc), + mload(sLoc) + ) + } + } + } + /// @dev Contract's underlying balance withdraw method. /// @dev Function sighash: 0x5fd8c710. function withdrawBalance() external onlyOwner { diff --git a/contracts/lib/metatx/ERC2771Context.sol b/contracts/lib/metatx/ERC2771Context.sol new file mode 100644 index 0000000..04c75c7 --- /dev/null +++ b/contracts/lib/metatx/ERC2771Context.sol @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.8.4; + +/// @author OpenZeppelin Contracts v4.4.1 (utils/Context.sol) +/// (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol) + +/// @dev Provides information about the current execution context, including the +/// sender of the transaction and its data. While these are generally available +/// via msg.sender and msg.data, they should not be accessed in such a direct +/// manner, since when dealing with meta-transactions the account sending and +/// paying for execution may not be the actual sender (as far as an application +/// is concerned). +/// +/// This contract is only required for intermediate, library-like contracts. +abstract contract Context { + function _msgSender() + internal + view + virtual + returns (address) + { + return msg.sender; + } + + function _msgData() + internal + view + virtual + returns (bytes calldata) + { + return msg.data; + } +} + +/// @author Modified from OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol) +/// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/ERC2771Context.sol + +/// @dev Context variant with ERC2771 support. +abstract contract ERC2771Context is Context { + // address private immutable _trustedForwarder; + mapping(address => bool) public isTrustedForwarder; + + /// @custom:oz-upgrades-unsafe-allow constructor + // constructor(address trustedForwarder) { + // _trustedForwarder = trustedForwarder; + // } + + function _msgSender() + internal + view + virtual + override + returns (address sender) + { + if (isTrustedForwarder[msg.sender]) { + // The assembly code is more direct than the Solidity version using `abi.decode`. + /// @solidity memory-safe-assembly + assembly { + sender := shr( + 96, + calldataload(sub(calldatasize(), 20)) + ) + } + } else { + return super._msgSender(); + } + } + + function _isTrustedForwarder() + internal + view + returns (address _sender, uint256 _forwarder) + { + _sender = _msgSender(); + _forwarder = (_sender != msg.sender) + ? uint256(1) + : uint256(0); + } + + function _msgData() + internal + view + virtual + override + returns (bytes calldata) + { + if (isTrustedForwarder[msg.sender]) { + return msg.data[:msg.data.length - 20]; + } else { + return super._msgData(); + } + } +} diff --git a/contracts/p2pix.sol b/contracts/p2pix.sol index 0c89f62..f98159e 100644 --- a/contracts/p2pix.sol +++ b/contracts/p2pix.sol @@ -11,11 +11,11 @@ pragma solidity 0.8.19; import { OwnerSettings, ERC20, SafeTransferLib } from "./core/OwnerSettings.sol"; import { BaseUtils } from "./core/BaseUtils.sol"; -import { ReentrancyGuard } from "./lib/utils/ReentrancyGuard.sol"; import { DataTypes as DT } from "./core/DataTypes.sol"; -contract P2PIX is BaseUtils, ReentrancyGuard { + +contract P2PIX is BaseUtils { // solhint-disable use-forbidden-name // solhint-disable no-inline-assembly // solhint-disable no-empty-blocks @@ -62,19 +62,20 @@ contract P2PIX is BaseUtils, ReentrancyGuard { function deposit( address _token, uint96 _amount, - uint160 _pixTarget, + string memory _pixTarget, bool _valid, bytes32 allowlistRoot ) public { ERC20 t = ERC20(_token); uint256 k = _castAddrToKey(msg.sender); - if (_pixTarget == 0) revert EmptyPixTarget(); + if (bytes(_pixTarget).length == 0) revert EmptyPixTarget(); if (!allowedERC20s(t)) revert TokenDenied(); - uint256 _sellerBalance = sellerBalance(k,t); + uint256 _sellerBalance = __sellerBalance(k,t); uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY; - if ((currBal + _amount) > MAXBALANCE_UPPERBOUND) + uint256 _newBal = uint256(currBal + _amount); + if (_newBal > MAXBALANCE_UPPERBOUND) revert MaxBalExceeded(); setReentrancyGuard(); @@ -83,21 +84,14 @@ contract P2PIX is BaseUtils, ReentrancyGuard { setRoot(msg.sender, allowlistRoot); } - uint256 amountCasted; - uint256 pixTargetCasted; - uint256 validCasted; - ( - amountCasted, - pixTargetCasted, - validCasted - ) = _castToUint(_amount, _pixTarget, _valid); + bytes32 pixTargetCasted = getStr(_pixTarget); + uint256 validCasted = _castBool(_valid); _setSellerBalance( k, t, - ((currBal + amountCasted) | - (pixTargetCasted << BITPOS_PIXTARGET) | - (validCasted << BITPOS_VALID)) + (_newBal | (validCasted << BITPOS_VALID)), + pixTargetCasted ); SafeTransferLib.safeTransferFrom( @@ -118,19 +112,16 @@ contract P2PIX is BaseUtils, ReentrancyGuard { /// @dev Function sighash: 0x72fada5c. function setValidState(ERC20 token, bool state) public { uint256 key = _castAddrToKey(msg.sender); - uint256 _sellerBalance = sellerBalance(key, token); + uint256 _sellerBalance = __sellerBalance(key, token); if (_sellerBalance != 0) { - uint256 _valid; - assembly { - _valid := state - } + uint256 _valid = _castBool(state); _sellerBalance = - (_sellerBalance & BITMASK_VALID) | + (_sellerBalance & BITMASK_SB_ENTRY) | (_valid << BITPOS_VALID); - _setSellerBalance(key, token, _sellerBalance); + _setValidState(key, token, _sellerBalance); emit ValidSet(msg.sender, address(token), state); } else revert NotInitialized(); @@ -175,33 +166,43 @@ contract P2PIX is BaseUtils, ReentrancyGuard { mapLocks[cCounter].expirationBlock >= block.number ) revert NotExpired(); + address sender; uint256 forwarder; + (sender, forwarder) = _isTrustedForwarder(); + DT.Lock memory l = DT.Lock( - _amount, - uint160(sellerBalance(k, t) >> BITPOS_PIXTARGET), - address(t), - msg.sender, k, cCounter, - (block.number + defaultLockBlocks) + (block.number + defaultLockBlocks), + getPixTarget(_seller, t), + _amount, + address(t), + sender ); + // transaction forwarding must leave `merkleProof` empty; + // otherwise, the trustedForwarder must be previously added + // to a seller whitelist. if (merkleProof.length != 0) { - _merkleVerify(merkleProof, sellerAllowList(k), msg.sender); + _merkleVerify(merkleProof, sellerAllowList(k), sender); lockID = _addLock(bal, _amount, cCounter, l, t, k); } else { if (l.amount <= REPUTATION_LOWERBOUND) { lockID = _addLock(bal, _amount, cCounter, l, t, k); + } else { + if (forwarder != 0) { + lockID = _addLock(bal, _amount, cCounter, l, t, k); } else { uint256 userCredit = userRecord[_castAddrToKey(msg.sender)]; uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD); if ( - l.amount > (spendLimit * WAD) || l.amount > LOCKAMOUNT_UPPERBOUND + l.amount > (spendLimit * WAD) || + l.amount > LOCKAMOUNT_UPPERBOUND ) revert AmountNotAllowed(); lockID = _addLock(bal, _amount, cCounter, l, t, k); - /* */}/* */} + /* */}/* */}/* */} } /// @notice Lock release method that liquidate lock @@ -241,20 +242,23 @@ contract P2PIX is BaseUtils, ReentrancyGuard { ERC20 t = ERC20(l.token); - // We cache values before zeroing them out. + // We cache lockAmount value before zeroing it out. uint256 lockAmount = l.amount; - // uint256 totalAmount = (lockAmount - l.relayerPremium); l.amount = 0; l.expirationBlock = 0; _setUsedTransactions(message); + address sender; uint256 forwarder; + (sender, forwarder) = _isTrustedForwarder(); + + if (forwarder == 0) { if (msg.sender != l.buyerAddress) { userRecord[_castAddrToKey(msg.sender)] += (lockAmount >> 1); userRecord[_castAddrToKey(l.buyerAddress)] += (lockAmount >> 1); } else { userRecord[_castAddrToKey(msg.sender)] += lockAmount; - } + }} SafeTransferLib.safeTransfer( t, @@ -283,7 +287,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard { _notExpired(l); uint256 _sellerBalance = - sellerBalance(l.sellerKey, ERC20(l.token)) & BITMASK_SB_ENTRY; + __sellerBalance(l.sellerKey, ERC20(l.token)) & BITMASK_SB_ENTRY; if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND) revert MaxBalExceeded(); @@ -335,7 +339,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard { uint256 key = _castAddrToKey(msg.sender); _decBal( - (sellerBalance(key, token) & BITMASK_SB_ENTRY), + (__sellerBalance(key, token) & BITMASK_SB_ENTRY), amount, token, key @@ -407,7 +411,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard { mapLocks[_lockID] = _l; _decBal(_bal, _amount, _t, _k); - lockCounter++; + ++lockCounter; counter = _lockID; emit LockAdded( @@ -448,9 +452,6 @@ contract P2PIX is BaseUtils, ReentrancyGuard { view returns (uint256 bal) { - // bal = - // sellerBalance[_castAddrToKey(seller)][token] & - // BITMASK_SB_ENTRY; assembly { for { /* */ @@ -462,7 +463,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard { mstore(0x00, seller) bal := and( BITMASK_SB_ENTRY, - sload(keccak256(0x0c, 0x34)) + sload(add(keccak256(0x0c, 0x34), 0x01)) ) break } @@ -474,10 +475,6 @@ contract P2PIX is BaseUtils, ReentrancyGuard { view returns (bool valid) { - // uint256 b = sellerBalance[ - // _castAddrToKey(seller) - // ][token]; - // ] >> BITPOS_VALID) & BITMASK_SB_ENTRY; assembly { for { /* */ @@ -491,7 +488,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard { BITMASK_SB_ENTRY, shr( BITPOS_VALID, - sload(keccak256(0x0c, 0x34)) + sload(add(keccak256(0x0c, 0x34), 0x01)) ) ) break @@ -502,12 +499,8 @@ contract P2PIX is BaseUtils, ReentrancyGuard { function getPixTarget(address seller, ERC20 token) public view - returns (uint160 pixTarget) + returns (bytes32 pixTarget) { - // pixTarget = uint160( - // sellerBalance[_castAddrToKey(seller)][token] >> - // BITPOS_PIXTARGET - // ); assembly { for { /* */ @@ -517,15 +510,17 @@ contract P2PIX is BaseUtils, ReentrancyGuard { mstore(0x20, token) mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) mstore(0x00, seller) - pixTarget := shr( - BITPOS_PIXTARGET, - sload(keccak256(0x0c, 0x34)) - ) + pixTarget := sload(keccak256(0x0c, 0x34)) break } } } + function getPixTargetString(address seller, ERC20 token) public view returns (string memory pixTarget) { + bytes32 _pixEnc = getPixTarget(seller, token); + pixTarget = string(abi.encodePacked(_pixEnc)); + } + function getBalances( address[] memory sellers, ERC20 token @@ -593,42 +588,53 @@ contract P2PIX is BaseUtils, ReentrancyGuard { return (sortedIDs, status); } - function _setSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 packed) private { + function _setSellerBalance(uint256 _sellerKey, ERC20 _erc20, uint256 _packed, bytes32 _pixTarget) private { assembly { - mstore(0x20, erc20) + mstore(0x20, _erc20) mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) - mstore(0x00, shr(12, sellerKey)) - sstore(keccak256(0x0c, 0x34), packed) + mstore(0x00, shr(12, _sellerKey)) + let _loc := keccak256(0x0c, 0x34) + sstore(add(_loc, 0x01), _packed) + sstore(_loc, _pixTarget) } } - function _addSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 amount) private { + function _setValidState(uint256 _sellerKey, ERC20 _erc20, uint256 _packed) private { assembly { - mstore(0x20, erc20) + mstore(0x20, _erc20) mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) - mstore(0x00, shr(12, sellerKey)) - let slot := keccak256(0x0c, 0x34) - sstore(slot, add(sload(slot), amount)) + mstore(0x00, shr(12, _sellerKey)) + let _loc := keccak256(0x0c, 0x34) + sstore(add(_loc, 0x01), _packed) } } - function _decSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 amount) private { + function _addSellerBalance(uint256 _sellerKey, ERC20 _erc20, uint256 _amount) private { assembly { - mstore(0x20, erc20) + mstore(0x20, _erc20) mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) - mstore(0x00, shr(12, sellerKey)) - let slot := keccak256(0x0c, 0x34) - sstore(slot, sub(sload(slot), amount)) + mstore(0x00, shr(12, _sellerKey)) + let _loc := add(keccak256(0x0c, 0x34), 0x01) + sstore(_loc, add(sload(_loc), _amount)) } } - function sellerBalance(uint256 sellerKey, ERC20 erc20) public view returns(uint256 packed) { + function _decSellerBalance(uint256 _sellerKey, ERC20 _erc20, uint256 _amount) private { assembly { - mstore(0x20, erc20) + mstore(0x20, _erc20) mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) - mstore(0x00, shr(12, sellerKey)) - packed := sload(keccak256(0x0c, 0x34)) + mstore(0x00, shr(12, _sellerKey)) + let _loc := add(keccak256(0x0c, 0x34), 0x01) + sstore(_loc, sub(sload(_loc), _amount)) + } + } + function __sellerBalance(uint256 _sellerKey, ERC20 _erc20) private view returns(uint256 _packed) { + assembly { + mstore(0x20, _erc20) + mstore(0x0c, _SELLER_BALANCE_SLOT_SEED) + mstore(0x00, shr(12, _sellerKey)) + _packed := sload(add(keccak256(0x0c, 0x34), 0x01)) } } diff --git a/src/types/core/BaseUtils.ts b/src/types/core/BaseUtils.ts index dfc18cd..950cc5a 100644 --- a/src/types/core/BaseUtils.ts +++ b/src/types/core/BaseUtils.ts @@ -33,12 +33,15 @@ export interface BaseUtilsInterface extends utils.Interface { "_castKeyToAddr(uint256)": FunctionFragment; "allowedERC20s(address)": FunctionFragment; "defaultLockBlocks()": FunctionFragment; + "getStr(string)": FunctionFragment; + "isTrustedForwarder(address)": FunctionFragment; "owner()": FunctionFragment; "reputation()": FunctionFragment; "sellerAllowList(uint256)": FunctionFragment; "setDefaultLockBlocks(uint256)": FunctionFragment; "setOwner(address)": FunctionFragment; "setReputation(address)": FunctionFragment; + "setTrustedFowarders(address[],bool[])": FunctionFragment; "setValidSigners(address[])": FunctionFragment; "tokenSettings(address[],bool[])": FunctionFragment; "usedTransactions(bytes32)": FunctionFragment; @@ -52,12 +55,15 @@ export interface BaseUtilsInterface extends utils.Interface { | "_castKeyToAddr" | "allowedERC20s" | "defaultLockBlocks" + | "getStr" + | "isTrustedForwarder" | "owner" | "reputation" | "sellerAllowList" | "setDefaultLockBlocks" | "setOwner" | "setReputation" + | "setTrustedFowarders" | "setValidSigners" | "tokenSettings" | "usedTransactions" @@ -81,6 +87,14 @@ export interface BaseUtilsInterface extends utils.Interface { functionFragment: "defaultLockBlocks", values?: undefined ): string; + encodeFunctionData( + functionFragment: "getStr", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "isTrustedForwarder", + values: [PromiseOrValue] + ): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData( functionFragment: "reputation", @@ -102,6 +116,10 @@ export interface BaseUtilsInterface extends utils.Interface { functionFragment: "setReputation", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setTrustedFowarders", + values: [PromiseOrValue[], PromiseOrValue[]] + ): string; encodeFunctionData( functionFragment: "setValidSigners", values: [PromiseOrValue[]] @@ -139,6 +157,11 @@ export interface BaseUtilsInterface extends utils.Interface { functionFragment: "defaultLockBlocks", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "getStr", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isTrustedForwarder", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result; decodeFunctionResult( @@ -154,6 +177,10 @@ export interface BaseUtilsInterface extends utils.Interface { functionFragment: "setReputation", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setTrustedFowarders", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setValidSigners", data: BytesLike @@ -187,6 +214,7 @@ export interface BaseUtilsInterface extends utils.Interface { "OwnerUpdated(address,address)": EventFragment; "ReputationUpdated(address)": EventFragment; "RootUpdated(address,bytes32)": EventFragment; + "TrustedForwarderUpdated(address,bool)": EventFragment; "ValidSet(address,address,bool)": EventFragment; "ValidSignersUpdated(address[])": EventFragment; }; @@ -202,6 +230,7 @@ export interface BaseUtilsInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment; } @@ -334,6 +363,18 @@ export type RootUpdatedEvent = TypedEvent< export type RootUpdatedEventFilter = TypedEventFilter; +export interface TrustedForwarderUpdatedEventObject { + forwarder: string; + state: boolean; +} +export type TrustedForwarderUpdatedEvent = TypedEvent< + [string, boolean], + TrustedForwarderUpdatedEventObject +>; + +export type TrustedForwarderUpdatedEventFilter = + TypedEventFilter; + export interface ValidSetEventObject { seller: string; token: string; @@ -401,6 +442,16 @@ export interface BaseUtils extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>; + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { strEnc: string }>; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + owner(overrides?: CallOverrides): Promise<[string]>; reputation(overrides?: CallOverrides): Promise<[string]>; @@ -425,6 +476,12 @@ export interface BaseUtils extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -468,6 +525,16 @@ export interface BaseUtils extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -492,6 +559,12 @@ export interface BaseUtils extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -535,6 +608,16 @@ export interface BaseUtils extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -559,6 +642,12 @@ export interface BaseUtils extends BaseContract { overrides?: CallOverrides ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: CallOverrides + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: CallOverrides @@ -680,6 +769,15 @@ export interface BaseUtils extends BaseContract { merkleRoot?: PromiseOrValue | null ): RootUpdatedEventFilter; + "TrustedForwarderUpdated(address,bool)"( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + TrustedForwarderUpdated( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + "ValidSet(address,address,bool)"( seller?: PromiseOrValue | null, token?: null, @@ -715,6 +813,16 @@ export interface BaseUtils extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -739,6 +847,12 @@ export interface BaseUtils extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -783,6 +897,16 @@ export interface BaseUtils extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -807,6 +931,12 @@ export interface BaseUtils extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } diff --git a/src/types/core/EventAndErrors.ts b/src/types/core/EventAndErrors.ts index 37b5097..b988e9a 100644 --- a/src/types/core/EventAndErrors.ts +++ b/src/types/core/EventAndErrors.ts @@ -33,6 +33,7 @@ export interface EventAndErrorsInterface extends utils.Interface { "LockReturned(address,uint256)": EventFragment; "ReputationUpdated(address)": EventFragment; "RootUpdated(address,bytes32)": EventFragment; + "TrustedForwarderUpdated(address,bool)": EventFragment; "ValidSet(address,address,bool)": EventFragment; "ValidSignersUpdated(address[])": EventFragment; }; @@ -47,6 +48,7 @@ export interface EventAndErrorsInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "LockReturned"): EventFragment; getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment; } @@ -168,6 +170,18 @@ export type RootUpdatedEvent = TypedEvent< export type RootUpdatedEventFilter = TypedEventFilter; +export interface TrustedForwarderUpdatedEventObject { + forwarder: string; + state: boolean; +} +export type TrustedForwarderUpdatedEvent = TypedEvent< + [string, boolean], + TrustedForwarderUpdatedEventObject +>; + +export type TrustedForwarderUpdatedEventFilter = + TypedEventFilter; + export interface ValidSetEventObject { seller: string; token: string; @@ -309,6 +323,15 @@ export interface EventAndErrors extends BaseContract { merkleRoot?: PromiseOrValue | null ): RootUpdatedEventFilter; + "TrustedForwarderUpdated(address,bool)"( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + TrustedForwarderUpdated( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + "ValidSet(address,address,bool)"( seller?: PromiseOrValue | null, token?: null, diff --git a/src/types/core/OwnerSettings.ts b/src/types/core/OwnerSettings.ts index 3437ba9..e75e6b7 100644 --- a/src/types/core/OwnerSettings.ts +++ b/src/types/core/OwnerSettings.ts @@ -31,12 +31,14 @@ export interface OwnerSettingsInterface extends utils.Interface { functions: { "allowedERC20s(address)": FunctionFragment; "defaultLockBlocks()": FunctionFragment; + "isTrustedForwarder(address)": FunctionFragment; "owner()": FunctionFragment; "reputation()": FunctionFragment; "sellerAllowList(uint256)": FunctionFragment; "setDefaultLockBlocks(uint256)": FunctionFragment; "setOwner(address)": FunctionFragment; "setReputation(address)": FunctionFragment; + "setTrustedFowarders(address[],bool[])": FunctionFragment; "setValidSigners(address[])": FunctionFragment; "tokenSettings(address[],bool[])": FunctionFragment; "validBacenSigners(uint256)": FunctionFragment; @@ -47,12 +49,14 @@ export interface OwnerSettingsInterface extends utils.Interface { nameOrSignatureOrTopic: | "allowedERC20s" | "defaultLockBlocks" + | "isTrustedForwarder" | "owner" | "reputation" | "sellerAllowList" | "setDefaultLockBlocks" | "setOwner" | "setReputation" + | "setTrustedFowarders" | "setValidSigners" | "tokenSettings" | "validBacenSigners" @@ -67,6 +71,10 @@ export interface OwnerSettingsInterface extends utils.Interface { functionFragment: "defaultLockBlocks", values?: undefined ): string; + encodeFunctionData( + functionFragment: "isTrustedForwarder", + values: [PromiseOrValue] + ): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData( functionFragment: "reputation", @@ -88,6 +96,10 @@ export interface OwnerSettingsInterface extends utils.Interface { functionFragment: "setReputation", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setTrustedFowarders", + values: [PromiseOrValue[], PromiseOrValue[]] + ): string; encodeFunctionData( functionFragment: "setValidSigners", values: [PromiseOrValue[]] @@ -113,6 +125,10 @@ export interface OwnerSettingsInterface extends utils.Interface { functionFragment: "defaultLockBlocks", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "isTrustedForwarder", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result; decodeFunctionResult( @@ -128,6 +144,10 @@ export interface OwnerSettingsInterface extends utils.Interface { functionFragment: "setReputation", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setTrustedFowarders", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setValidSigners", data: BytesLike @@ -157,6 +177,7 @@ export interface OwnerSettingsInterface extends utils.Interface { "OwnerUpdated(address,address)": EventFragment; "ReputationUpdated(address)": EventFragment; "RootUpdated(address,bytes32)": EventFragment; + "TrustedForwarderUpdated(address,bool)": EventFragment; "ValidSet(address,address,bool)": EventFragment; "ValidSignersUpdated(address[])": EventFragment; }; @@ -172,6 +193,7 @@ export interface OwnerSettingsInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment; } @@ -304,6 +326,18 @@ export type RootUpdatedEvent = TypedEvent< export type RootUpdatedEventFilter = TypedEventFilter; +export interface TrustedForwarderUpdatedEventObject { + forwarder: string; + state: boolean; +} +export type TrustedForwarderUpdatedEvent = TypedEvent< + [string, boolean], + TrustedForwarderUpdatedEventObject +>; + +export type TrustedForwarderUpdatedEventFilter = + TypedEventFilter; + export interface ValidSetEventObject { seller: string; token: string; @@ -361,6 +395,11 @@ export interface OwnerSettings extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + owner(overrides?: CallOverrides): Promise<[string]>; reputation(overrides?: CallOverrides): Promise<[string]>; @@ -385,6 +424,12 @@ export interface OwnerSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -413,6 +458,11 @@ export interface OwnerSettings extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -437,6 +487,12 @@ export interface OwnerSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -465,6 +521,11 @@ export interface OwnerSettings extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -489,6 +550,12 @@ export interface OwnerSettings extends BaseContract { overrides?: CallOverrides ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: CallOverrides + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: CallOverrides @@ -605,6 +672,15 @@ export interface OwnerSettings extends BaseContract { merkleRoot?: PromiseOrValue | null ): RootUpdatedEventFilter; + "TrustedForwarderUpdated(address,bool)"( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + TrustedForwarderUpdated( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + "ValidSet(address,address,bool)"( seller?: PromiseOrValue | null, token?: null, @@ -630,6 +706,11 @@ export interface OwnerSettings extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -654,6 +735,12 @@ export interface OwnerSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -683,6 +770,11 @@ export interface OwnerSettings extends BaseContract { defaultLockBlocks(overrides?: CallOverrides): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + owner(overrides?: CallOverrides): Promise; reputation(overrides?: CallOverrides): Promise; @@ -707,6 +799,12 @@ export interface OwnerSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } diff --git a/src/types/factories/Reputation__factory.ts b/src/types/factories/Reputation__factory.ts index 1903d03..ba1d7b6 100644 --- a/src/types/factories/Reputation__factory.ts +++ b/src/types/factories/Reputation__factory.ts @@ -1,7 +1,13 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; +import { + Signer, + utils, + Contract, + ContractFactory, + PayableOverrides, +} from "ethers"; import type { Provider, TransactionRequest } from "@ethersproject/providers"; import type { PromiseOrValue } from "../common"; import type { Reputation, ReputationInterface } from "../Reputation"; @@ -9,7 +15,7 @@ import type { Reputation, ReputationInterface } from "../Reputation"; const _abi = [ { inputs: [], - stateMutability: "nonpayable", + stateMutability: "payable", type: "constructor", }, { @@ -60,7 +66,7 @@ const _abi = [ ]; const _bytecode = - "0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033"; + "0x6080806040526102c990816100128239f3fe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033"; type ReputationConstructorParams = | [signer?: Signer] @@ -80,12 +86,12 @@ export class Reputation__factory extends ContractFactory { } override deploy( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: PromiseOrValue } ): Promise { return super.deploy(overrides || {}) as Promise; } override getDeployTransaction( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: PayableOverrides & { from?: PromiseOrValue } ): TransactionRequest { return super.getDeployTransaction(overrides || {}); } diff --git a/src/types/factories/core/BaseUtils__factory.ts b/src/types/factories/core/BaseUtils__factory.ts index 6bcc05c..864435a 100644 --- a/src/types/factories/core/BaseUtils__factory.ts +++ b/src/types/factories/core/BaseUtils__factory.ts @@ -87,6 +87,11 @@ const _abi = [ name: "OnlySeller", type: "error", }, + { + inputs: [], + name: "Reentrancy", + type: "error", + }, { inputs: [], name: "StaticCallFailed", @@ -334,6 +339,25 @@ const _abi = [ name: "RootUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "forwarder", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "state", + type: "bool", + }, + ], + name: "TrustedForwarderUpdated", + type: "event", + }, { anonymous: false, inputs: [ @@ -442,6 +466,44 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "string", + name: "str", + type: "string", + }, + ], + name: "getStr", + outputs: [ + { + internalType: "bytes32", + name: "strEnc", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "owner", @@ -526,6 +588,24 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address[]", + name: "forwarders", + type: "address[]", + }, + { + internalType: "bool[]", + name: "states", + type: "bool[]", + }, + ], + name: "setTrustedFowarders", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/src/types/factories/core/EventAndErrors__factory.ts b/src/types/factories/core/EventAndErrors__factory.ts index 404b45b..9039b98 100644 --- a/src/types/factories/core/EventAndErrors__factory.ts +++ b/src/types/factories/core/EventAndErrors__factory.ts @@ -313,6 +313,25 @@ const _abi = [ name: "RootUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "forwarder", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "state", + type: "bool", + }, + ], + name: "TrustedForwarderUpdated", + type: "event", + }, { anonymous: false, inputs: [ diff --git a/src/types/factories/core/OwnerSettings__factory.ts b/src/types/factories/core/OwnerSettings__factory.ts index bfe7567..0ce0e26 100644 --- a/src/types/factories/core/OwnerSettings__factory.ts +++ b/src/types/factories/core/OwnerSettings__factory.ts @@ -337,6 +337,25 @@ const _abi = [ name: "RootUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "forwarder", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "state", + type: "bool", + }, + ], + name: "TrustedForwarderUpdated", + type: "event", + }, { anonymous: false, inputs: [ @@ -407,6 +426,25 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "owner", @@ -491,6 +529,24 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address[]", + name: "forwarders", + type: "address[]", + }, + { + internalType: "bool[]", + name: "states", + type: "bool[]", + }, + ], + name: "setTrustedFowarders", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/src/types/factories/lib/index.ts b/src/types/factories/lib/index.ts index 3b6ecbf..3ea6176 100644 --- a/src/types/factories/lib/index.ts +++ b/src/types/factories/lib/index.ts @@ -3,6 +3,7 @@ /* eslint-disable */ export * as auth from "./auth"; export * as interfaces from "./interfaces"; +export * as metatx from "./metatx"; export * as mock from "./mock"; export * as tokens from "./tokens"; export * as utils from "./utils"; diff --git a/src/types/factories/lib/metatx/ERC2771Context__factory.ts b/src/types/factories/lib/metatx/ERC2771Context__factory.ts new file mode 100644 index 0000000..8503166 --- /dev/null +++ b/src/types/factories/lib/metatx/ERC2771Context__factory.ts @@ -0,0 +1,45 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + ERC2771Context, + ERC2771ContextInterface, +} from "../../../lib/metatx/ERC2771Context"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, +]; + +export class ERC2771Context__factory { + static readonly abi = _abi; + static createInterface(): ERC2771ContextInterface { + return new utils.Interface(_abi) as ERC2771ContextInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ERC2771Context { + return new Contract(address, _abi, signerOrProvider) as ERC2771Context; + } +} diff --git a/src/types/factories/lib/metatx/index.ts b/src/types/factories/lib/metatx/index.ts new file mode 100644 index 0000000..47f15ea --- /dev/null +++ b/src/types/factories/lib/metatx/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { ERC2771Context__factory } from "./ERC2771Context__factory"; diff --git a/src/types/factories/p2pix.sol/P2PIX__factory.ts b/src/types/factories/p2pix.sol/P2PIX__factory.ts index 6c22f29..a5637b4 100644 --- a/src/types/factories/p2pix.sol/P2PIX__factory.ts +++ b/src/types/factories/p2pix.sol/P2PIX__factory.ts @@ -377,6 +377,25 @@ const _abi = [ name: "RootUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "forwarder", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "state", + type: "bool", + }, + ], + name: "TrustedForwarderUpdated", + type: "event", + }, { anonymous: false, inputs: [ @@ -498,9 +517,9 @@ const _abi = [ type: "uint96", }, { - internalType: "uint160", + internalType: "string", name: "_pixTarget", - type: "uint160", + type: "string", }, { internalType: "bool", @@ -606,14 +625,57 @@ const _abi = [ name: "getPixTarget", outputs: [ { - internalType: "uint160", + internalType: "bytes32", name: "pixTarget", - type: "uint160", + type: "bytes32", }, ], stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "seller", + type: "address", + }, + { + internalType: "contract ERC20", + name: "token", + type: "address", + }, + ], + name: "getPixTargetString", + outputs: [ + { + internalType: "string", + name: "pixTarget", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "str", + type: "string", + }, + ], + name: "getStr", + outputs: [ + { + internalType: "bytes32", + name: "strEnc", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, { inputs: [ { @@ -638,6 +700,25 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "isTrustedForwarder", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -700,26 +781,6 @@ const _abi = [ ], name: "mapLocks", outputs: [ - { - internalType: "uint80", - name: "amount", - type: "uint80", - }, - { - internalType: "uint160", - name: "pixTarget", - type: "uint160", - }, - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "buyerAddress", - type: "address", - }, { internalType: "uint256", name: "sellerKey", @@ -735,6 +796,26 @@ const _abi = [ name: "expirationBlock", type: "uint256", }, + { + internalType: "bytes32", + name: "pixTarget", + type: "bytes32", + }, + { + internalType: "uint80", + name: "amount", + type: "uint80", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "buyerAddress", + type: "address", + }, ], stateMutability: "view", type: "function", @@ -817,30 +898,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [ - { - internalType: "uint256", - name: "sellerKey", - type: "uint256", - }, - { - internalType: "contract ERC20", - name: "erc20", - type: "address", - }, - ], - name: "sellerBalance", - outputs: [ - { - internalType: "uint256", - name: "packed", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { @@ -898,6 +955,24 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address[]", + name: "forwarders", + type: "address[]", + }, + { + internalType: "bool[]", + name: "states", + type: "bool[]", + }, + ], + name: "setTrustedFowarders", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -1054,7 +1129,7 @@ const _abi = [ ]; const _bytecode = - "0x60806040526200293e80380380620000178162000126565b928339810160a0828203126200010b5781516020808401519093916001600160401b03918281116200010b5784620000519185016200017f565b9062000060604085016200016a565b9260608501518181116200010b57866200007c9187016200017f565b9460808101519182116200010b57019480601f870112156200010b578551620000af620000a98262000152565b62000126565b96888089848152019260051b8201019283116200010b578801905b828210620000f157505050620000e19550620001e6565b6040516124fc9081620004428239f35b815180151581036200010b578152908801908801620000ca565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176200014c57604052565b62000110565b6001600160401b0381116200014c5760051b60200190565b51906001600160a01b03821682036200010b57565b9080601f830112156200010b578151906200019e620000a98362000152565b9182938184526020808095019260051b8201019283116200010b578301905b828210620001cc575050505090565b838091620001da846200016a565b815201910190620001bd565b600080546001600160a01b031916339081178255929695949392817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3816002556040519182527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208093a18651878301979060051b810183013d1515895b811562000306575b5050506040519280840191818552518092526040840198925b828110620002e85750505050907f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d782620002d593620002db97980390a16001600160a01b031662000337565b62000390565b620002e66001600355565b565b83516001600160a01b03168a52988101989281019260010162000289565b9085826001829697989451600c1b550190838210156200032c5791509493929462000268565b509493929462000270565b6000546001600160a01b0390811633036200037f57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360015560405191168152a1565b6040516282b42960e81b8152600490fd5b60008054919290916001600160a01b031633036200037f5782519182156200043457815183036200042757602092919284818080970195019360051b0101925b838103620003df575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003d0565b63ff633a3890526004601cfd5b63df95788390526004601cfdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc578063328a7181146101f7578063367821f0146101f2578063461f3120146101ac57806349ef8448146101ed5780634b2ae980146101e8578063574983c8146101e35780635fd8c710146101de57806369cc6af4146101d95780636d82d9e0146101d457806377cd38a4146101cf5780637f94f65d146101ca57806380e1d302146101c557806384ab1d28146101c05780638da5cb5b146101bb5780638db564c2146101b65780639872dbfe146101b157806398a26871146101ac5780639eee8d4b146101a7578063ad8f2eed146101a2578063b0983d391461019d578063c52164c614610198578063c593dfd814610193578063d1c070281461018e578063d4fac45d14610189578063d6e8b97314610184578063dc43221c1461017f578063f7d0e04b1461017a5763fb8c5ef00361000e5761142c565b6113bc565b611321565b611276565b61125d565b6111bb565b610e65565b610e31565b610df7565b610d70565b610d30565b610808565b610d12565b610cf4565b610cc0565b610c8a565b610c71565b610c20565b610be8565b610ad7565b610a97565b610a14565b6109b0565b610986565b6108eb565b610776565b610545565b610497565b61036a565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b6040519060e0820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f8201121561023257803591610319836102cc565b926103276040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610351575050505090565b838091833561035f816102e4565b815201910190610343565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039c903690600401610302565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046d57805181830192849160051b830181013d1515855b8115610439575b50505060405192818401908285525180915260408401949160005b828110610423577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f4565b90838260018298969499979951600c1b550190838210156104615791509593959492946103d2565b509593959492946103d9565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b4816102e4565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361023257565b3590811515820361023257565b346102325760a060031936011261023257600435610562816102e4565b6024356bffffffffffffffffffffffff8116908181036102325760443590610589826102e4565b610591610529565b6084359373ffffffffffffffffffffffffffffffffffffffff8087169033600c1b9086161561074c576105d96105d58363cbc9d1c4600c526000526020600c205490565b1590565b610722576b3fffffffffffffffffffffff61060a83839060205263739094b1600c52600c1c6000526034600c205490565b16906a52b7d2dcc80cd2e4000000610622858461163a565b116106f857826106e39761069c9661066e89610693967f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf9d610662611647565b806106e8575b5061163a565b9060ff1b91605f1b1717919060205263739094b1600c52600c1c6000526034600c2055565b30903390611682565b6106a66001600355565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2005b6106f29033611f47565b38610668565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b3461023257602060031936011261023257600435600052600560205260e0604060002080549073ffffffffffffffffffffffffffffffffffffffff90816001820154168260028301541660038301549160056004850154940154946040519669ffffffffffffffffffff8116885260501c16602087015260408601526060850152608084015260a083015260c0820152f35b34610232576020600319360112610232576020600435546040519015158152f35b90815180825260208080930193019160005b828110610849575050505090565b83518552938101939281019260010161083b565b9061087090604083526040830190610829565b81810360209283015282518082529082019282019160009190825b82811061089a57505050505090565b909192939485516004808210156108bf5750815282019482019392919060010161088b565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610232576020806003193601126102325760043567ffffffffffffffff8111610232573660238201121561023257806004013590610929826102cc565b916109376040519384610266565b80835260248484019160051b8301019136831161023257602401905b8282106109775761096384612362565b906109736040519283928361085d565b0390f35b81358152908401908401610953565b346102325760206003193601126102325760206004356109a5816102e4565b60405190600c1b8152f35b346102325760206003193601126102325760043573ffffffffffffffffffffffffffffffffffffffff60005416330361046d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600255604051908152a1005b3461023257600080600319360112610a945773ffffffffffffffffffffffffffffffffffffffff815416330361046d57478180808084335af115610a87576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b34610232576020600319360112610232576020610acd600435610ab9816102e4565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3461023257604060031936011261023257600435610af4816102e4565b602435801515908181036102325733600c1b610b2684829060205263739094b1600c52600c1c6000526034600c205490565b918215610bbe57610b75927f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff869260ff1b911617919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff6040519216825260208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576020610c186004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461023257604060031936011261023257610019600435610c40816102e4565b60243590611f47565b600319604091011261023257600435610c61816102e4565b90602435610c6e816102e4565b90565b34610232576020610acd610c8436610c49565b906122aa565b3461023257602060031936011261023257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610232576000600319360112610232576020600454604051908152f35b34610232576000600319360112610232576020600254604051908152f35b34610232576040600319360112610232576020610c18602435610d52816102e4565b6004359060205263739094b1600c52600c1c6000526034600c205490565b3461023257610d7e36610c49565b6000903d15610da9575b60208273ffffffffffffffffffffffffffffffffffffffff60405191168152f35b60205263739094b1600c525260206034600c2054605f1c38610d88565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051b01011161023257565b346102325760206003193601126102325760043567ffffffffffffffff811161023257610e2b610019913690600401610dc6565b90611d29565b3461023257600060031936011261023257602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102325760a06003193601126102325760043560843560ff8116810361023257610e8e611647565b610ea2826000526005602052604060002090565b80549069ffffffffffffffffffff821691821561118057600582019081544311611156576110f784610fed936002611111966110347f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede89a610fc76040516020810190610fb781610f8b8d8c73ffffffffffffffffffffffffffffffffffffffff6024359260501c1687917fffffffffffffffffffff00000000000000000000000000000000000000000000907fffffffffffffffffffffffffffffffffffffffff000000000000000000000000603e959360601b16845260b01b166014830152601e8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610266565b5190209160643560443584611bae565b6000611006610fed600186015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b84547fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000168555955560019055565b0193611057610fed865473ffffffffffffffffffffffffffffffffffffffff1690565b331461112c57697fffffffffffffffffff9060011c1661108433600c1b6000526006602052604060002090565b61108f82825461163a565b90556110d66110ce6110be6110b8885473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526006602052604060002090565b91825461163a565b90555b835473ffffffffffffffffffffffffffffffffffffffff1690611c9c565b5473ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600355565b5061114433600c1b6000526006602052604060002090565b61114f83825461163a565b90556110d9565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610c6e928181520190610829565b346102325760406003193601126102325760043567ffffffffffffffff8111610232576111ec903690600401610302565b602435906111f9826102e4565b600091815191611208836122ff565b935b83811061121f576040518061097387826111aa565b8061124c8473ffffffffffffffffffffffffffffffffffffffff6112456001958761234e565b5116612273565b611256828861234e565b520161120a565b34610232576020610c1861127036610c49565b90612273565b346102325760406003193601126102325767ffffffffffffffff600435818111610232576112a8903690600401610302565b9060243590811161023257366023820112156102325780600401356112cc816102cc565b916112da6040519384610266565b81835260209160248385019160051b8301019136831161023257602401905b82821061130a576100198587611541565b83809161131684610538565b8152019101906112f9565b346102325760a06003193601126102325760043561133e816102e4565b6024359061134b826102e4565b6044359169ffffffffffffffffffff831683036102325767ffffffffffffffff9160643583811161023257611384903690600401610dc6565b9060843594851161023257610973956113a46113ac963690600401610dc6565b959094611793565b6040519081529081906020820190565b34610232576020600319360112610232576004356113d9816102e4565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361046d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360015560405191168152a1005b3461023257606060031936011261023257600435611449816102e4565b60243560443567ffffffffffffffff8111610232577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916114a2611494611529933690600401610dc6565b9061149d611647565b611d29565b6114ac84336122aa565b611533575b6114ed33600c1b85836b3fffffffffffffffffffffff6114e783859060205263739094b1600c52600c1c6000526034600c205490565b16612237565b6114f8813386611c9c565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600355005b61153c846116db565b6114b1565b9060009073ffffffffffffffffffffffffffffffffffffffff825416330361046d5782519182156115eb57815183036115de57602092919284818080970195019360051b0101925b838103611597575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191611589565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b906001820180921161163557565b6115f8565b9190820180921161163557565b600260035414611658576002600355565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d156001600051141716156116cd576000606052604052565b637939f4246000526004601cfd5b33600c1b6116ff82829060205263739094b1600c52600c1c6000526034600c205490565b908115610bbe57827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117489316919060205263739094b1600c52600c1c6000526034600c2055565b73ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b956117b89073ffffffffffffffffffffffffffffffffffffffff93949661149d611647565b16916117c76105d584876122aa565b611a60576117d58386612273565b9469ffffffffffffffffffff9182841691828810611a3657600c1b956117fc600454611627565b936005611813866000526005602052604060002090565b0154431115611a0c5761185b61183f888a9060205263739094b1600c52600c1c6000526034600c205490565b605f1c73ffffffffffffffffffffffffffffffffffffffff1690565b6118a561186a6002544361163a565b916118886118766102ac565b69ffffffffffffffffffff909a168a52565b73ffffffffffffffffffffffffffffffffffffffff166020890152565b73ffffffffffffffffffffffffffffffffffffffff881660408801523360608801526080870189905260a0870186905260c0870152821561191f5750611912979161190d9133916119078a6374dfee70600c52600c1c60005260206000205490565b91611aa7565b611fe2565b9061191d6001600355565b565b80925068056bc75e2d631000009150611942865169ffffffffffffffffffff1690565b1611611957575061195295611fe2565b611912565b61198861198361197433600c1b6000526006602052604060002090565b54670de0b6b3a7640000900490565b611b35565b816119a66119a0875169ffffffffffffffffffff1690565b92611a8a565b9116119081156119e9575b506119bf5761195295611fe2565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b845169d3c21bcecceda1000000925069ffffffffffffffffffff161611386119b1565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a76400009182810292818404149015171561163557565b73ffffffffffffffffffffffffffffffffffffffff8293941692611af9575b505003611acf57565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611b2a579290611b03565b509150503880611ac6565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102a7576020926000926040525190600154617530fa906000519115611ba057565b63e10bf1cc6000526004601cfd5b918254611c725760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611c65576060526040829052600c1b5415611c3d5750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611cd857603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9190811015611d245760051b0190565b611ce5565b6000905b828210611d4a575010611d3c57565b63dfb035c96000526004601cfd5b90611d6a611d59828585611d14565b356000526005602052604060002090565b90611d7482611f96565b6003820154600192611d9f610fed8583015473ffffffffffffffffffffffffffffffffffffffff1690565b906b3fffffffffffffffffffffff611dcd83859060205263739094b1600c52600c1c6000526034600c205490565b16926a52b7d2dcc80cd2e4000000611e0b611e04611df5855469ffffffffffffffffffff1690565b69ffffffffffffffffffff1690565b809661163a565b116106f857611ed693600293611e3a929060205263739094b1600c52600c1c6000526034600c20908154019055565b80547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016815501611e826110b8825473ffffffffffffffffffffffffffffffffffffffff1690565b611ea0611e99826000526006602052604060002090565b5460011c90565b68056bc75e2d631000008111611f2c5750611ec86110f7916000526006602052604060002090565b68056bc75e2d631000009055565b7f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da573ffffffffffffffffffffffffffffffffffffffff611f17848888611d14565b60405190358152921691602090a20190611d2d565b90611f41906000526006602052604060002090565b556110f7565b338103611f88576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60058101544310611a0c575469ffffffffffffffffffff161561118057565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116355760010190565b9594906121c073ffffffffffffffffffffffffffffffffffffffff927f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949687600052600560205260406000209361207869ffffffffffffffffffff895116869069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60208801517fffff0000000000000000000000000000000000000000ffffffffffffffffffff7dffffffffffffffffffffffffffffffffffffffff0000000000000000000087549260501b1691161785556121316120ed60408a015173ffffffffffffffffffffffffffffffffffffffff1690565b600187019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b606088019a61219b6121578d5173ffffffffffffffffffffffffffffffffffffffff1690565b600288019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b60808901958651600382015560a08a01516004820155600560c08b0151910155612237565b6121d36121ce600454611fb5565b600455565b61223261220b6121f887995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176122655760205263739094b1600c52600c1c6000526034600c20908154039055565b63ce3a3d376000526004601cfd5b600092913d15612281575050565b9091925060205263739094b1600c526000526034600c20546b3fffffffffffffffffffffff1690565b600092913d156122b8575050565b9091925060205263739094b1600c526000526034600c205460ff1c90565b6040516020810181811067ffffffffffffffff8211176102a75760405260008152906000368137565b90612309826102cc565b6123166040519182610266565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061234482946102cc565b0190602036910137565b8051821015611d245760209160051b010190565b908151156124b3576000809280519061237a826122ff565b92612384836122ff565b955b83811061239557505050509190565b8060036123b86123a76001948761234e565b516000526005602052604060002090565b01546123e9576123c8818561234e565b516123d3828861234e565b52826123df828a61234e565b5201925b92612386565b69ffffffffffffffffffff6124146124046123a7848861234e565b5469ffffffffffffffffffff1690565b1661244957612423818561234e565b5161242e828861234e565b5261244261243c828a61234e565b60039052565b01926123e3565b60056124586123a7838761234e565b015443111561248a5761246b818561234e565b51612476828861234e565b52612442612484828a61234e565b60029052565b612494818561234e565b5161249f828861234e565b526124426124ad828a61234e565b60019052565b90506124bd6122d6565b90610c6e6122d656fea2646970667358221220216bb367f4639b3049c82d8c672f33139a235b727196b97dde2a622dee39d79b64736f6c63430008130033"; + "0x608060405262002c0a80380380620000178162000126565b928339810160a0828203126200010b5781516020808401519093916001600160401b03918281116200010b5784620000519185016200017f565b9062000060604085016200016a565b9260608501518181116200010b57866200007c9187016200017f565b9460808101519182116200010b57019480601f870112156200010b578551620000af620000a98262000152565b62000126565b96888089848152019260051b8201019283116200010b578801905b828210620000f157505050620000e19550620001e6565b6040516127c89081620004428239f35b815180151581036200010b578152908801908801620000ca565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176200014c57604052565b62000110565b6001600160401b0381116200014c5760051b60200190565b51906001600160a01b03821682036200010b57565b9080601f830112156200010b578151906200019e620000a98362000152565b9182938184526020808095019260051b8201019283116200010b578301905b828210620001cc575050505090565b838091620001da846200016a565b815201910190620001bd565b600080546001600160a01b031916339081178255929695949392817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3816003556040519182527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208093a18651878301979060051b810183013d1515895b811562000306575b5050506040519280840191818552518092526040840198925b828110620002e85750505050907f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d782620002d593620002db97980390a16001600160a01b031662000337565b62000390565b620002e66001600455565b565b83516001600160a01b03168a52988101989281019260010162000289565b9085826001829697989451600c1b550190838210156200032c5791509493929462000268565b509493929462000270565b6000546001600160a01b0390811633036200037f57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360025560405191168152a1565b6040516282b42960e81b8152600490fd5b60008054919290916001600160a01b031633036200037f5782519182156200043457815183036200042757602092919284818080970195019360051b0101925b838103620003df575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003d0565b63ff633a3890526004601cfd5b63df95788390526004601cfdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102365780630d2a2d441461023157806313af40351461022c578063367821f014610227578063461f3120146101d757806349ef8448146102225780634b2ae9801461021d578063572b6c0514610218578063574983c8146102135780635fd8c7101461020e57806369cc6af4146102095780636d82d9e01461020457806377cd38a4146101ff5780637f94f65d146101fa57806380e1d302146101f557806384ab1d28146101f05780638da5cb5b146101eb5780638db564c2146101e6578063918dff57146101e15780639872dbfe146101dc57806398a26871146101d75780639b6d694d146101d2578063ad8f2eed146101cd578063b0983d39146101c8578063c52164c6146101c3578063c593dfd8146101be578063d1c07028146101b9578063d1ced2b0146101b4578063d4fac45d146101af578063d6e8b973146101aa578063dc43221c146101a5578063e449c52a146101a0578063f7d0e04b1461019b5763fb8c5ef00361000e57611532565b6114c2565b611487565b6113ec565b61133a565b611321565b611272565b61112c565b610dfb565b610dc7565b610d8d565b610d49565b610cd9565b6105eb565b610c46565b610bbb565b610b7a565b610b46565b610b10565b610af7565b610aa6565b610a6e565b610917565b6108ca565b610847565b6107e3565b610793565b610769565b6106ce565b610559565b6104c7565b61039a565b346102625760206003193601126102625760043560005260076020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102d757604052565b610267565b6040519060e0820182811067ffffffffffffffff8211176102d757604052565b67ffffffffffffffff81116102d75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361026257565b81601f8201121561026257803591610349836102fc565b926103576040519485610296565b808452602092838086019260051b820101928311610262578301905b828210610381575050505090565b838091833561038f81610314565b815201910190610373565b34610262576020806003193601126102625760043567ffffffffffffffff8111610262576103cc903690600401610332565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361049d57805181830192849160051b830181013d1515855b8115610469575b50505060405192818401908285525180915260408401949160005b828110610453577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610424565b90838260018298969499979951600c1b55019083821015610491579150959395949294610402565b50959395949294610409565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576004356104e481610314565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361049d577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b3461026257602060031936011261026257600435600052600660205260e060406000208054906005600182015491600281015460038201549060048301549273ffffffffffffffffffffffffffffffffffffffff9485910154169460405196875260208701526040860152606085015269ffffffffffffffffffff8116608085015260501c1660a083015260c0820152f35b34610262576020600319360112610262576020600435546040519015158152f35b90815180825260208080930193019160005b82811061062c575050505090565b83518552938101939281019260010161061e565b906106539060408352604083019061060c565b81810360209283015282518082529082019282019160009190825b82811061067d57505050505090565b909192939485516004808210156106a25750815282019482019392919060010161066e565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610262576020806003193601126102625760043567ffffffffffffffff811161026257366023820112156102625780600401359061070c826102fc565b9161071a6040519384610296565b80835260248484019160051b8301019136831161026257602401905b82821061075a576107468461262e565b9061075660405192839283610640565b0390f35b81358152908401908401610736565b3461026257602060031936011261026257602060043561078881610314565b60405190600c1b8152f35b346102625760206003193601126102625773ffffffffffffffffffffffffffffffffffffffff6004356107c581610314565b166000526001602052602060ff604060002054166040519015158152f35b346102625760206003193601126102625760043573ffffffffffffffffffffffffffffffffffffffff60005416330361049d576020817f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851192600355604051908152a1005b34610262576000806003193601126108c75773ffffffffffffffffffffffffffffffffffffffff815416330361049d57478180808084335af1156108ba576040805133815260208101929092527feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d91a180f35b63b12d13eb82526004601cfd5b80fd5b346102625760206003193601126102625760206109006004356108ec81610314565b63cbc9d1c4600c526000526020600c205490565b6040519015158152f35b3590811515820361026257565b346102625760406003193601126102625760043561093481610314565b602435801515810361026257602082905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44577fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4991610a3f918460205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000526b3fffffffffffffffffffffff82605f1b91161760016034600c20015560405191829173ffffffffffffffffffffffffffffffffffffffff3396168390929160209073ffffffffffffffffffffffffffffffffffffffff60408401951683521515910152565b0390a2005b60046040517f87138d5c000000000000000000000000000000000000000000000000000000008152fd5b34610262576020600319360112610262576020610a9e6004356374dfee70600c52600c1c60005260206000205490565b604051908152f35b3461026257604060031936011261026257610019600435610ac681610314565b60243590612221565b600319604091011261026257600435610ae781610314565b90602435610af481610314565b90565b34610262576020610900610b0a36610acf565b9061253c565b3461026257602060031936011261026257602060405173ffffffffffffffffffffffffffffffffffffffff600435600c1c168152f35b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610262576000600319360112610262576020600554604051908152f35b60005b838110610bab5750506000910152565b8181015183820152602001610b9b565b3461026257610bd2610bcc36610acf565b90612579565b604051906020820190815260208252604082019180831067ffffffffffffffff8411176102d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60409385855260208652610c3d845180928160608801526080870190610b98565b01168101030190f35b34610262576000600319360112610262576020600354604051908152f35b81601f820112156102625780359067ffffffffffffffff82116102d75760405192610cb760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610296565b8284526020838301011161026257816000926020809301838601378301015290565b346102625760a060031936011261026257600435610cf681610314565b602435906bffffffffffffffffffffffff821682036102625760443567ffffffffffffffff811161026257610d2f903690600401610c64565b6064359081151582036102625761001993608435936116cf565b34610262576020610a9e610bcc36610acf565b9181601f840112156102625782359167ffffffffffffffff8311610262576020808501948460051b01011161026257565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610dc1610019913690600401610d5c565b90612023565b3461026257600060031936011261026257602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b346102625760a06003193601126102625760043560843560ff8116810361026257610e246118c5565b610e38826000526006602052604060002090565b6004810180549169ffffffffffffffffffff83169283156110f15760028201805443116110c75784600584610f5d7f364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8996000610fac96610f56610fdf9b610f2e89610ef2610f1e610fc69f6003015460405192839160208301956024359187917fffffffffffffffffffff0000000000000000000000000000000000000000000090604a9492845260b01b166020830152602a8201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610296565b5190209560643560443588611ea8565b7fffffffffffffffffffffffffffffffffffffffffffff000000000000000000008154169055565b5560019055565b610f65611e33565b905015610ffa575b019273ffffffffffffffffffffffffffffffffffffffff610fa2855473ffffffffffffffffffffffffffffffffffffffff1690565b9160501c16611f96565b5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60408051948552602085019290925292a26100196001600455565b81810161101e610fc6825473ffffffffffffffffffffffffffffffffffffffff1690565b33146110a45761109d61109561108561107f697fffffffffffffffffff8a60011c169461105833600c1b6000526007602052604060002090565b6110638782546116c2565b90555473ffffffffffffffffffffffffffffffffffffffff1690565b600c1b90565b6000526007602052604060002090565b9182546116c2565b9055610f6d565b506110bc33600c1b6000526007602052604060002090565b61109d8482546116c2565b60046040517ff6fafba0000000000000000000000000000000000000000000000000000000008152fd5b60046040517f63b4904e000000000000000000000000000000000000000000000000000000008152fd5b906020610af492818152019061060c565b346102625760406003193601126102625760043567ffffffffffffffff81116102625761115d903690600401610332565b6024359061116a82610314565b600091815191611179836125cb565b935b8381106111905760405180610756878261111b565b806111bd8473ffffffffffffffffffffffffffffffffffffffff6111b66001958761261a565b5116612502565b6111c7828861261a565b520161117b565b9060406003198301126102625767ffffffffffffffff9160043583811161026257816111fc91600401610332565b92602435908111610262578160238201121561026257806004013591611221836102fc565b9261122f6040519485610296565b80845260209260248486019260051b82010192831161026257602401905b82821061125b575050505090565b8380916112678461090a565b81520191019061124d565b3461026257611280366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d57825190811561131f57805182036113125790602084818080970194019260051b0101915b8281036112d0578380f35b8480916001825280518652835180604088205581517fbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df928880a3019101906112c5565b63ff633a3883526004601cfd5bfe5b34610262576020610a9e61133436610acf565b90612502565b3461026257611348366111ce565b60009073ffffffffffffffffffffffffffffffffffffffff825416330361049d5782519081156113df57805182036113125790602084818080970194019260051b0101915b828103611398578380f35b84809181600c63cbc9d1c48152825188528551918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8880a30191019061138d565b63df95788383526004601cfd5b346102625760a06003193601126102625760043561140981610314565b6024359061141682610314565b6044359169ffffffffffffffffffff831683036102625767ffffffffffffffff916064358381116102625761144f903690600401610d5c565b90608435948511610262576107569561146f611477963690600401610d5c565b959094611a2f565b6040519081529081906020820190565b346102625760206003193601126102625760043567ffffffffffffffff811161026257610a9e6114bd6020923690600401610c64565b61164a565b34610262576020600319360112610262576004356114df81610314565b73ffffffffffffffffffffffffffffffffffffffff8060005416330361049d57816020917fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9360025560405191168152a1005b346102625760606003193601126102625760043561154f81610314565b60243560443567ffffffffffffffff8111610262577f2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e916115a861159a611632933690600401610d5c565b906115a36118c5565b612023565b6115b2843361253c565b61163c575b6115f633600c1b85836b3fffffffffffffffffffffff6115f083859060205263739094b1600c52600c1c60005260016034600c20015490565b166124c3565b611601813386611f96565b6040805173ffffffffffffffffffffffffffffffffffffffff95909516855260208501919091523393918291820190565b0390a26001600455005b61164584611959565b6115b7565b604051611674602082816116678183019687815193849201610b98565b8101038084520182610296565b5160201061131f575190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90600182018092116116bd57565b611680565b919082018092116116bd57565b939273ffffffffffffffffffffffffffffffffffffffff85169333600c1b9484511561189b576117146117108263cbc9d1c4600c526000526020600c205490565b1590565b611871576b3fffffffffffffffffffffff61174882889060205263739094b1600c52600c1c60005260016034600c20015490565b16916117636bffffffffffffffffffffffff861680946116c2565b936a52b7d2dcc80cd2e40000008511611847577f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf97836117eb966117bc6118329a6117e2966117b06118c5565b80611837575b5061164a565b93605f1b17919060205263739094b1600c52600c1c6000526034600c2090600182015555565b30903390611900565b6117f56001600455565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2565b6118419033612221565b386117b6565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b6002600454146118d6576002600455565b60046040517fab143c06000000000000000000000000000000000000000000000000000000008152fd5b601c600060649281946020966040519860605260405260601b602c526f23b872dd000000000000000000000000600c525af13d1560016000511417161561194b576000606052604052565b637939f4246000526004601cfd5b602081905263739094b1600c9081527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff331660005260349020600101548015610a44576b3fffffffffffffffffffffff908260205263739094b1600c527e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33166000521660016034600c20015573ffffffffffffffffffffffffffffffffffffffff60405191168152600060208201527fca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d4960403392a2565b9295611a559073ffffffffffffffffffffffffffffffffffffffff9395966115a36118c5565b1691611a64611710848461253c565b611ce557611a728383612502565b9469ffffffffffffffffffff80831691828810611cbb5784600c1b96611a996005546116af565b946002611ab0876000526006602052604060002090565b0154431115611c9157611ac1611e33565b611ada8a611ad4600398949854436116c2565b9a612579565b611ae26102dc565b998c8b528960208c015260408b015260608a0152611b1060808a0193849069ffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8a1660a08a015273ffffffffffffffffffffffffffffffffffffffff861660c08a01528315611b8e5750505091611b7c91611b819993611b768a6374dfee70600c52600c1c60005260206000205490565b91611d2c565b6122bf565b90611b8c6001600455565b565b9250819450809350611bb468056bc75e2d63100000925169ffffffffffffffffffff1690565b1611611bcb57505050611bc6956122bf565b611b81565b15611bdb575050611bc6956122bf565b611c0c611c07611bf833600c1b6000526007602052604060002090565b54670de0b6b3a7640000900490565b611dba565b81611c2a611c24855169ffffffffffffffffffff1690565b92611d0f565b911611918215611c6e575b5050611c4457611bc6956122bf565b60046040517f1c18f846000000000000000000000000000000000000000000000000000000008152fd5b5169d3c21bcecceda1000000925069ffffffffffffffffffff1616113880611c35565b60046040517fd0404f85000000000000000000000000000000000000000000000000000000008152fd5b60046040517f22bbb43c000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb2e532de000000000000000000000000000000000000000000000000000000008152fd5b90670de0b6b3a7640000918281029281840414901517156116bd57565b73ffffffffffffffffffffffffffffffffffffffff8293941692611d7e575b505003611d5457565b60046040517f3b8474be000000000000000000000000000000000000000000000000000000008152fd5b60059291831b8101915b8135808211851b918252602080921852604060002091019282841015611daf579290611d88565b509150503880611d4b565b6040519060208201907f4d2b1791000000000000000000000000000000000000000000000000000000008252602483015260248252606082019082821067ffffffffffffffff8311176102d7576020926000926040525190600254617530fa906000519115611e2557565b63e10bf1cc6000526004601cfd5b611e3b611e61565b90600073ffffffffffffffffffffffffffffffffffffffff83163314610af45750600190565b33600052600160205260ff60406000205416600014611ea4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b3390565b918254611f6c5760806020927f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1948452600094859384927b19457468657265756d205369676e6564204d6573736167653a0a3332845260ff603c600420996040519a865216875260405280606052105afa508051903d15611f5f576060526040829052600c1b5415611f375750565b807f815e1d640000000000000000000000000000000000000000000000000000000060049252fd5b638baa579f90526004601cfd5b60046040517ff490a6ea000000000000000000000000000000000000000000000000000000008152fd5b60109260209260145260345260446000938480936fa9059cbb00000000000000000000000082525af13d156001835114171615611fd257603452565b6390b8ec1890526004601cfd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b919081101561201e5760051b0190565b611fdf565b6000905b82821061204457501061203657565b63dfb035c96000526004601cfd5b9061206461205382858561200e565b356000526006602052604060002090565b61206d81612270565b80549060048082019081549073ffffffffffffffffffffffffffffffffffffffff94858360501c16916a52b7d2dcc80cd2e40000006120ea69ffffffffffffffffffff6b3fffffffffffffffffffffff6120e087879060205263739094b1600c52600c1c60005260016034600c20015490565b16961680966116c2565b116121f95750936121477f830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da594610f2e6121bd9560059560019b9a999060205263739094b1600c52600c1c60005260016034600c2001908154019055565b0161216961107f825473ffffffffffffffffffffffffffffffffffffffff1690565b612187612180826000526007602052604060002090565b5460011c90565b68056bc75e2d6310000081116121de57506121af610fac916000526007602052604060002090565b68056bc75e2d631000009055565b916121c984888861200e565b60405190358152921691602090a20190612027565b906121f3906000526007602052604060002090565b55610fac565b6040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b338103612262576374dfee70600c5280600052816020600020557f0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632600080a3565b6385d1f7266000526004601cfd5b60028101544310611c91576004015469ffffffffffffffffffff16156110f157565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146116bd5760010190565b9261244c61240597967f8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65949673ffffffffffffffffffffffffffffffffffffffff94612358978960005260066020526124476040600020875181556020880151600182015560408801516002820155606088015160038201556123e36004820161238f60808b019d8e5169ffffffffffffffffffff1690565b829069ffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffff00000000000000000000825416179055565b60a08a015181547fffff0000000000000000000000000000000000000000ffffffffffffffffffff1660509190911b7dffffffffffffffffffffffffffffffffffffffff0000000000000000000016179055565b600560c089019e8f5173ffffffffffffffffffffffffffffffffffffffff1690565b91019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b6124c3565b61245f61245a600554612292565b600555565b6124be61249761248487995173ffffffffffffffffffffffffffffffffffffffff1690565b9251955169ffffffffffffffffffff1690565b60405193849316958390929169ffffffffffffffffffff6020916040840195845216910152565b0390a3565b9291909280848103119015176124f45760205263739094b1600c52600c1c60005260016034600c2001908154039055565b63ce3a3d376000526004601cfd5b600092913d15612510575050565b9091925060205263739094b1600c5260005260016034600c2001546b3fffffffffffffffffffffff1690565b600092913d1561254a575050565b9091925060205263739094b1600c5260005260016034600c200154605f1c6b3fffffffffffffffffffffff1690565b600092913d15612587575050565b9091925060205263739094b1600c526000526034600c205490565b6040516020810181811067ffffffffffffffff8211176102d75760405260008152906000368137565b906125d5826102fc565b6125e26040519182610296565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061261082946102fc565b0190602036910137565b805182101561201e5760209160051b010190565b9081511561277f5760008092805190612646826125cb565b92612650836125cb565b955b83811061266157505050509190565b806126826126716001938661261a565b516000526006602052604060002090565b546126b257612691818561261a565b5161269c828861261a565b52826126a8828a61261a565b5201925b92612652565b69ffffffffffffffffffff6126e060046126cf612671858961261a565b015469ffffffffffffffffffff1690565b16612715576126ef818561261a565b516126fa828861261a565b5261270e612708828a61261a565b60039052565b01926126ac565b6002612724612671838761261a565b015443111561275657612737818561261a565b51612742828861261a565b5261270e612750828a61261a565b60029052565b612760818561261a565b5161276b828861261a565b5261270e612779828a61261a565b60019052565b90506127896125a2565b90610af46125a256fea26469706673582212209ffa8d03f81d9a82810b196ea8ca2756ed5c27b9f6548170be7b687163a33fe864736f6c63430008130033"; type P2PIXConstructorParams = | [signer?: Signer] diff --git a/src/types/hardhat.d.ts b/src/types/hardhat.d.ts index 20159f7..76d0a09 100644 --- a/src/types/hardhat.d.ts +++ b/src/types/hardhat.d.ts @@ -32,6 +32,10 @@ declare module "hardhat/types/runtime" { name: "IReputation", signerOrOptions?: ethers.Signer | FactoryOptions ): Promise; + getContractFactory( + name: "ERC2771Context", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; getContractFactory( name: "MockToken", signerOrOptions?: ethers.Signer | FactoryOptions @@ -90,6 +94,11 @@ declare module "hardhat/types/runtime" { address: string, signer?: ethers.Signer ): Promise; + getContractAt( + name: "ERC2771Context", + address: string, + signer?: ethers.Signer + ): Promise; getContractAt( name: "MockToken", address: string, diff --git a/src/types/index.ts b/src/types/index.ts index 7badac8..0a23f55 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -19,6 +19,8 @@ export type { Owned } from "./lib/auth/Owned"; export { Owned__factory } from "./factories/lib/auth/Owned__factory"; export type { IReputation } from "./lib/interfaces/IReputation"; export { IReputation__factory } from "./factories/lib/interfaces/IReputation__factory"; +export type { ERC2771Context } from "./lib/metatx/ERC2771Context"; +export { ERC2771Context__factory } from "./factories/lib/metatx/ERC2771Context__factory"; export type { MockToken } from "./lib/mock/mockToken.sol/MockToken"; export { MockToken__factory } from "./factories/lib/mock/mockToken.sol/MockToken__factory"; export type { ERC20 } from "./lib/tokens/ERC20"; diff --git a/src/types/lib/index.ts b/src/types/lib/index.ts index 68b6eeb..087add9 100644 --- a/src/types/lib/index.ts +++ b/src/types/lib/index.ts @@ -5,6 +5,8 @@ import type * as auth from "./auth"; export type { auth }; import type * as interfaces from "./interfaces"; export type { interfaces }; +import type * as metatx from "./metatx"; +export type { metatx }; import type * as mock from "./mock"; export type { mock }; import type * as tokens from "./tokens"; diff --git a/src/types/lib/metatx/ERC2771Context.ts b/src/types/lib/metatx/ERC2771Context.ts new file mode 100644 index 0000000..70bdd8c --- /dev/null +++ b/src/types/lib/metatx/ERC2771Context.ts @@ -0,0 +1,103 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "../../common"; + +export interface ERC2771ContextInterface extends utils.Interface { + functions: { + "isTrustedForwarder(address)": FunctionFragment; + }; + + getFunction(nameOrSignatureOrTopic: "isTrustedForwarder"): FunctionFragment; + + encodeFunctionData( + functionFragment: "isTrustedForwarder", + values: [PromiseOrValue] + ): string; + + decodeFunctionResult( + functionFragment: "isTrustedForwarder", + data: BytesLike + ): Result; + + events: {}; +} + +export interface ERC2771Context extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ERC2771ContextInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + }; + + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + callStatic: { + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/src/types/lib/metatx/index.ts b/src/types/lib/metatx/index.ts new file mode 100644 index 0000000..d5e1c80 --- /dev/null +++ b/src/types/lib/metatx/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { ERC2771Context } from "./ERC2771Context"; diff --git a/src/types/p2pix.sol/P2PIX.ts b/src/types/p2pix.sol/P2PIX.ts index eb77337..2688053 100644 --- a/src/types/p2pix.sol/P2PIX.ts +++ b/src/types/p2pix.sol/P2PIX.ts @@ -33,12 +33,15 @@ export interface P2PIXInterface extends utils.Interface { "_castKeyToAddr(uint256)": FunctionFragment; "allowedERC20s(address)": FunctionFragment; "defaultLockBlocks()": FunctionFragment; - "deposit(address,uint96,uint160,bool,bytes32)": FunctionFragment; + "deposit(address,uint96,string,bool,bytes32)": FunctionFragment; "getBalance(address,address)": FunctionFragment; "getBalances(address[],address)": FunctionFragment; "getLocksStatus(uint256[])": FunctionFragment; "getPixTarget(address,address)": FunctionFragment; + "getPixTargetString(address,address)": FunctionFragment; + "getStr(string)": FunctionFragment; "getValid(address,address)": FunctionFragment; + "isTrustedForwarder(address)": FunctionFragment; "lock(address,address,uint80,bytes32[],uint256[])": FunctionFragment; "lockCounter()": FunctionFragment; "mapLocks(uint256)": FunctionFragment; @@ -46,11 +49,11 @@ export interface P2PIXInterface extends utils.Interface { "release(uint256,bytes32,bytes32,bytes32,uint8)": FunctionFragment; "reputation()": FunctionFragment; "sellerAllowList(uint256)": FunctionFragment; - "sellerBalance(uint256,address)": FunctionFragment; "setDefaultLockBlocks(uint256)": FunctionFragment; "setOwner(address)": FunctionFragment; "setReputation(address)": FunctionFragment; "setRoot(address,bytes32)": FunctionFragment; + "setTrustedFowarders(address[],bool[])": FunctionFragment; "setValidSigners(address[])": FunctionFragment; "setValidState(address,bool)": FunctionFragment; "tokenSettings(address[],bool[])": FunctionFragment; @@ -73,7 +76,10 @@ export interface P2PIXInterface extends utils.Interface { | "getBalances" | "getLocksStatus" | "getPixTarget" + | "getPixTargetString" + | "getStr" | "getValid" + | "isTrustedForwarder" | "lock" | "lockCounter" | "mapLocks" @@ -81,11 +87,11 @@ export interface P2PIXInterface extends utils.Interface { | "release" | "reputation" | "sellerAllowList" - | "sellerBalance" | "setDefaultLockBlocks" | "setOwner" | "setReputation" | "setRoot" + | "setTrustedFowarders" | "setValidSigners" | "setValidState" | "tokenSettings" @@ -118,7 +124,7 @@ export interface P2PIXInterface extends utils.Interface { values: [ PromiseOrValue, PromiseOrValue, - PromiseOrValue, + PromiseOrValue, PromiseOrValue, PromiseOrValue ] @@ -139,10 +145,22 @@ export interface P2PIXInterface extends utils.Interface { functionFragment: "getPixTarget", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "getPixTargetString", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getStr", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "getValid", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "isTrustedForwarder", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "lock", values: [ @@ -180,10 +198,6 @@ export interface P2PIXInterface extends utils.Interface { functionFragment: "sellerAllowList", values: [PromiseOrValue] ): string; - encodeFunctionData( - functionFragment: "sellerBalance", - values: [PromiseOrValue, PromiseOrValue] - ): string; encodeFunctionData( functionFragment: "setDefaultLockBlocks", values: [PromiseOrValue] @@ -200,6 +214,10 @@ export interface P2PIXInterface extends utils.Interface { functionFragment: "setRoot", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setTrustedFowarders", + values: [PromiseOrValue[], PromiseOrValue[]] + ): string; encodeFunctionData( functionFragment: "setValidSigners", values: [PromiseOrValue[]] @@ -271,7 +289,16 @@ export interface P2PIXInterface extends utils.Interface { functionFragment: "getPixTarget", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "getPixTargetString", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getStr", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getValid", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isTrustedForwarder", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "lock", data: BytesLike): Result; decodeFunctionResult( functionFragment: "lockCounter", @@ -285,10 +312,6 @@ export interface P2PIXInterface extends utils.Interface { functionFragment: "sellerAllowList", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "sellerBalance", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "setDefaultLockBlocks", data: BytesLike @@ -299,6 +322,10 @@ export interface P2PIXInterface extends utils.Interface { data: BytesLike ): Result; decodeFunctionResult(functionFragment: "setRoot", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setTrustedFowarders", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setValidSigners", data: BytesLike @@ -342,6 +369,7 @@ export interface P2PIXInterface extends utils.Interface { "OwnerUpdated(address,address)": EventFragment; "ReputationUpdated(address)": EventFragment; "RootUpdated(address,bytes32)": EventFragment; + "TrustedForwarderUpdated(address,bool)": EventFragment; "ValidSet(address,address,bool)": EventFragment; "ValidSignersUpdated(address[])": EventFragment; }; @@ -357,6 +385,7 @@ export interface P2PIXInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment; } @@ -489,6 +518,18 @@ export type RootUpdatedEvent = TypedEvent< export type RootUpdatedEventFilter = TypedEventFilter; +export interface TrustedForwarderUpdatedEventObject { + forwarder: string; + state: boolean; +} +export type TrustedForwarderUpdatedEvent = TypedEvent< + [string, boolean], + TrustedForwarderUpdatedEventObject +>; + +export type TrustedForwarderUpdatedEventFilter = + TypedEventFilter; + export interface ValidSetEventObject { seller: string; token: string; @@ -559,7 +600,7 @@ export interface P2PIX extends BaseContract { deposit( _token: PromiseOrValue, _amount: PromiseOrValue, - _pixTarget: PromiseOrValue, + _pixTarget: PromiseOrValue, _valid: PromiseOrValue, allowlistRoot: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -586,7 +627,18 @@ export interface P2PIX extends BaseContract { seller: PromiseOrValue, token: PromiseOrValue, overrides?: CallOverrides - ): Promise<[BigNumber] & { pixTarget: BigNumber }>; + ): Promise<[string] & { pixTarget: string }>; + + getPixTargetString( + seller: PromiseOrValue, + token: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { pixTarget: string }>; + + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { strEnc: string }>; getValid( seller: PromiseOrValue, @@ -594,6 +646,11 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise<[boolean] & { valid: boolean }>; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + lock( _seller: PromiseOrValue, _token: PromiseOrValue, @@ -609,22 +666,14 @@ export interface P2PIX extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [ - BigNumber, - BigNumber, - string, - string, - BigNumber, - BigNumber, - BigNumber - ] & { - amount: BigNumber; - pixTarget: BigNumber; - token: string; - buyerAddress: string; + [BigNumber, BigNumber, BigNumber, string, BigNumber, string, string] & { sellerKey: BigNumber; counter: BigNumber; expirationBlock: BigNumber; + pixTarget: string; + amount: BigNumber; + token: string; + buyerAddress: string; } >; @@ -646,12 +695,6 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise<[string] & { root: string }>; - sellerBalance( - sellerKey: PromiseOrValue, - erc20: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { packed: BigNumber }>; - setDefaultLockBlocks( _blocks: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -673,6 +716,12 @@ export interface P2PIX extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -742,7 +791,7 @@ export interface P2PIX extends BaseContract { deposit( _token: PromiseOrValue, _amount: PromiseOrValue, - _pixTarget: PromiseOrValue, + _pixTarget: PromiseOrValue, _valid: PromiseOrValue, allowlistRoot: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -769,7 +818,18 @@ export interface P2PIX extends BaseContract { seller: PromiseOrValue, token: PromiseOrValue, overrides?: CallOverrides - ): Promise; + ): Promise; + + getPixTargetString( + seller: PromiseOrValue, + token: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; getValid( seller: PromiseOrValue, @@ -777,6 +837,11 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + lock( _seller: PromiseOrValue, _token: PromiseOrValue, @@ -792,14 +857,14 @@ export interface P2PIX extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [BigNumber, BigNumber, string, string, BigNumber, BigNumber, BigNumber] & { - amount: BigNumber; - pixTarget: BigNumber; - token: string; - buyerAddress: string; + [BigNumber, BigNumber, BigNumber, string, BigNumber, string, string] & { sellerKey: BigNumber; counter: BigNumber; expirationBlock: BigNumber; + pixTarget: string; + amount: BigNumber; + token: string; + buyerAddress: string; } >; @@ -821,12 +886,6 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; - sellerBalance( - sellerKey: PromiseOrValue, - erc20: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - setDefaultLockBlocks( _blocks: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -848,6 +907,12 @@ export interface P2PIX extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -917,7 +982,7 @@ export interface P2PIX extends BaseContract { deposit( _token: PromiseOrValue, _amount: PromiseOrValue, - _pixTarget: PromiseOrValue, + _pixTarget: PromiseOrValue, _valid: PromiseOrValue, allowlistRoot: PromiseOrValue, overrides?: CallOverrides @@ -944,7 +1009,18 @@ export interface P2PIX extends BaseContract { seller: PromiseOrValue, token: PromiseOrValue, overrides?: CallOverrides - ): Promise; + ): Promise; + + getPixTargetString( + seller: PromiseOrValue, + token: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; getValid( seller: PromiseOrValue, @@ -952,6 +1028,11 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + lock( _seller: PromiseOrValue, _token: PromiseOrValue, @@ -967,22 +1048,14 @@ export interface P2PIX extends BaseContract { arg0: PromiseOrValue, overrides?: CallOverrides ): Promise< - [ - BigNumber, - BigNumber, - string, - string, - BigNumber, - BigNumber, - BigNumber - ] & { - amount: BigNumber; - pixTarget: BigNumber; - token: string; - buyerAddress: string; + [BigNumber, BigNumber, BigNumber, string, BigNumber, string, string] & { sellerKey: BigNumber; counter: BigNumber; expirationBlock: BigNumber; + pixTarget: string; + amount: BigNumber; + token: string; + buyerAddress: string; } >; @@ -1004,12 +1077,6 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; - sellerBalance( - sellerKey: PromiseOrValue, - erc20: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - setDefaultLockBlocks( _blocks: PromiseOrValue, overrides?: CallOverrides @@ -1031,6 +1098,12 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: CallOverrides + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: CallOverrides @@ -1175,6 +1248,15 @@ export interface P2PIX extends BaseContract { merkleRoot?: PromiseOrValue | null ): RootUpdatedEventFilter; + "TrustedForwarderUpdated(address,bool)"( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + TrustedForwarderUpdated( + forwarder?: PromiseOrValue | null, + state?: PromiseOrValue | null + ): TrustedForwarderUpdatedEventFilter; + "ValidSet(address,address,bool)"( seller?: PromiseOrValue | null, token?: null, @@ -1213,7 +1295,7 @@ export interface P2PIX extends BaseContract { deposit( _token: PromiseOrValue, _amount: PromiseOrValue, - _pixTarget: PromiseOrValue, + _pixTarget: PromiseOrValue, _valid: PromiseOrValue, allowlistRoot: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1242,12 +1324,28 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; + getPixTargetString( + seller: PromiseOrValue, + token: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + getValid( seller: PromiseOrValue, token: PromiseOrValue, overrides?: CallOverrides ): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + lock( _seller: PromiseOrValue, _token: PromiseOrValue, @@ -1282,12 +1380,6 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; - sellerBalance( - sellerKey: PromiseOrValue, - erc20: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - setDefaultLockBlocks( _blocks: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1309,6 +1401,12 @@ export interface P2PIX extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } @@ -1379,7 +1477,7 @@ export interface P2PIX extends BaseContract { deposit( _token: PromiseOrValue, _amount: PromiseOrValue, - _pixTarget: PromiseOrValue, + _pixTarget: PromiseOrValue, _valid: PromiseOrValue, allowlistRoot: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1408,12 +1506,28 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; + getPixTargetString( + seller: PromiseOrValue, + token: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getStr( + str: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + getValid( seller: PromiseOrValue, token: PromiseOrValue, overrides?: CallOverrides ): Promise; + isTrustedForwarder( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + lock( _seller: PromiseOrValue, _token: PromiseOrValue, @@ -1448,12 +1562,6 @@ export interface P2PIX extends BaseContract { overrides?: CallOverrides ): Promise; - sellerBalance( - sellerKey: PromiseOrValue, - erc20: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - setDefaultLockBlocks( _blocks: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1475,6 +1583,12 @@ export interface P2PIX extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setTrustedFowarders( + forwarders: PromiseOrValue[], + states: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setValidSigners( _validSigners: PromiseOrValue[], overrides?: Overrides & { from?: PromiseOrValue } diff --git a/test/p2pix.test.ts b/test/p2pix.test.ts index 87a9dfc..607c98e 100644 --- a/test/p2pix.test.ts +++ b/test/p2pix.test.ts @@ -302,7 +302,7 @@ describe("P2PIX", () => { }); describe("Deposit", async () => { it("should revert if ERC20 is not allowed", async () => { - const pTarget = ethers.BigNumber.from(7331); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; const root = ethers.utils.keccak256( ethers.utils.toUtf8Bytes("root"), ); @@ -326,7 +326,7 @@ describe("P2PIX", () => { const tx = p2pix.deposit( erc20.address, 1, - 0, + "", true, root, ); @@ -337,7 +337,7 @@ describe("P2PIX", () => { ); }); it("should revert if amount exceeds the balance limit", async () => { - const pTarget = ethers.BigNumber.from(7331); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; const root = ethers.utils.keccak256( ethers.utils.toUtf8Bytes("root"), ); @@ -355,7 +355,7 @@ describe("P2PIX", () => { ); }); it("should create deposit, update storage and emit event", async () => { - const pTarget = ethers.BigNumber.from(7331); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; // we use `hashZero` to avoid updating seller's allowlist settings const root = ethers.constants.HashZero; await erc20.approve(p2pix.address, price); @@ -387,6 +387,7 @@ describe("P2PIX", () => { erc20.address, ); + expect(tx).to.be.ok; await expect(tx) .to.emit(p2pix, "DepositAdded") @@ -397,7 +398,7 @@ describe("P2PIX", () => { ["-100000000000000000000", price], ); expect(storage).to.eq(price); - expect(pixTarget).to.eq(pTarget); + expect(pixTarget).to.eq(await p2pix.callStatic.getStr(pTarget)); expect(valid).to.eq(true); expect(allowList).to.eq(root); expect(balances[0]).to.eq(price); @@ -418,9 +419,9 @@ describe("P2PIX", () => { acc03.address, ); - const pTarget = ethers.BigNumber.from(7331); - const pTarget2 = ethers.BigNumber.from(1337); - const pTarget3 = ethers.BigNumber.from(3731); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; + const pTarget2 = "12312333321"; + const pTarget3 = "43999999999"; // we mock the allowlist root here only to test storage update. In depth // allowlist test coverage in both "Lock" and "Allowlist Settings" unit tests. const root = ethers.utils.keccak256( @@ -588,29 +589,29 @@ describe("P2PIX", () => { expect(prices[3]).to.eq(balances[3]); expect(storage1).to.eq(price); - expect(pixTarget1).to.eq(pTarget); + expect(pixTarget1).to.eq(await p2pix.callStatic.getStr(pTarget)); expect(valid1).to.eq(true); expect(allowList1).to.eq(root); expect(storage2).to.eq(price2); - expect(pixTarget2).to.eq(pTarget2); + expect(pixTarget2).to.eq(await p2pix.callStatic.getStr(pTarget2)); expect(valid2).to.eq(false); expect(allowList2).to.eq(nullRoot); expect(storage3).to.eq(price3); - expect(pixTarget3).to.eq(pTarget3); + expect(pixTarget3).to.eq(await p2pix.callStatic.getStr(pTarget3)); expect(valid3).to.eq(true); expect(allowList3).to.eq(root); expect(storage4).to.eq(price4); - expect(pixTarget4).to.eq(pTarget); + expect(pixTarget4).to.eq(await p2pix.callStatic.getStr(pTarget)); expect(valid4).to.eq(false); expect(allowList4).to.eq(nullRoot); }); }); describe("Lock", async () => { it("should revert if deposit is invalid", async () => { - const pTarget = ethers.BigNumber.from(7331); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -652,7 +653,7 @@ describe("P2PIX", () => { }); it("should revert if wished amount is greater than balance's remaining amount", async () => { await erc20.approve(p2pix.address, price); - const pTarget = ethers.BigNumber.from(1337); + const pTarget = "7ce3339x4133301u8f63pn71a5333118"; await p2pix.deposit( erc20.address, price, @@ -683,7 +684,7 @@ describe("P2PIX", () => { await p2pix.deposit( erc20.address, price, - ethers.BigNumber.from("1337"), + "7ce3339x4133301u8f63pn71a5333118", true, merkleRoot, ); @@ -716,7 +717,7 @@ describe("P2PIX", () => { await p2pix.deposit( erc20.address, price.mul(BigNumber.from("3")), - ethers.BigNumber.from("1"), + "1", true, merkleRoot, ); @@ -738,7 +739,7 @@ describe("P2PIX", () => { ); }); it("should create a lock, update storage and emit events via the allowlist path", async () => { - const target = ethers.BigNumber.from(101); + const target = "333"; await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -784,14 +785,14 @@ describe("P2PIX", () => { // ); expect(storage.amount).to.eq(price); expect(storage.expirationBlock).to.eq(expiration); - expect(storage.pixTarget).to.eq(target); + expect(storage.pixTarget).to.eq(await p2pix.callStatic.getStr(target)); expect(storage.buyerAddress).to.eq(acc01.address); // expect(storage.relayerAddress).to.eq(acc01.address); expect(storage.token).to.eq(erc20.address); }); it("should create a lock, update storage and emit events via the reputation path 1", async () => { const root = ethers.constants.HashZero; - const target = ethers.BigNumber.from(101); + const target = "101"; await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -833,7 +834,7 @@ describe("P2PIX", () => { // ); expect(storage.amount).to.eq(price); expect(storage.expirationBlock).to.eq(expiration); - expect(storage.pixTarget).to.eq(target); + expect(storage.pixTarget).to.eq(await p2pix.callStatic.getStr(target)); expect(storage.buyerAddress).to.eq(acc01.address); // expect(storage.relayerAddress).to.eq(acc01.address); expect(storage.token).to.eq(erc20.address); @@ -848,10 +849,10 @@ describe("P2PIX", () => { .mul(ethers.constants.Two) .add(ethers.constants.One); const endtoendID = ethers.constants.HashZero; - const target = ethers.BigNumber.from(101); + const target = "101"; const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [target, price, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(target), price, endtoendID], ); const messageHashBytes = ethers.utils.arrayify(messageToSign); @@ -922,7 +923,7 @@ describe("P2PIX", () => { price.add(ethers.constants.One), ); expect(storage.expirationBlock).to.eq(expiration); - expect(storage.pixTarget).to.eq(target); + expect(storage.pixTarget).to.eq(await p2pix.callStatic.getStr(target)); expect(storage.buyerAddress).to.eq(acc01.address); // expect(storage.relayerAddress).to.eq(acc01.address); expect(storage.token).to.eq(erc20.address); @@ -934,7 +935,7 @@ describe("P2PIX", () => { // edge case test it("should create multiple locks", async () => { const newPrice = price.div(ethers.BigNumber.from(2)); - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -1088,7 +1089,7 @@ describe("P2PIX", () => { expect(storage2.expirationBlock).to.eq(expiration2); expect(storage3.expirationBlock).to.eq(expiration3); - expect(target) + expect(await p2pix.callStatic.getStr(target)) .to.eq(storage1.pixTarget) .and.to.eq(storage2.pixTarget) .and.to.eq(storage3.pixTarget); @@ -1138,7 +1139,7 @@ describe("P2PIX", () => { await p2pix.deposit( erc20.address, price, - ethers.BigNumber.from(10101), + ethers.BigNumber.from(10101).toString(), true, merkleRoot, ); @@ -1165,7 +1166,7 @@ describe("P2PIX", () => { it("should cancel multiple balances", async () => { const hashZero = ethers.constants.HashZero; await erc20.mint([acc01.address, acc02.address], price); - const target = ethers.BigNumber.from("1"); + const target = ethers.BigNumber.from("1").toString(); await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -1255,7 +1256,7 @@ describe("P2PIX", () => { }); describe("Release", async () => { it("should revert if lock has expired", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); const messageToSign = ethers.utils.solidityKeccak256( ["uint160", "uint80", "bytes32"], [target, 100, ethers.constants.HashZero], @@ -1299,11 +1300,11 @@ describe("P2PIX", () => { ); }); it("should revert if lock has already been released", async () => { - const target = ethers.BigNumber.from("1"); + const target = ethers.BigNumber.from("1").toString(); const hashZero = ethers.constants.HashZero; const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [target, 100, hashZero], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(target), 100, hashZero], ); const flatSig = await acc01.signMessage( ethers.utils.arrayify(messageToSign), @@ -1350,10 +1351,10 @@ describe("P2PIX", () => { ); }); it("should revert if signed message has already been used", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [target, 100, ethers.constants.HashZero], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(target), 100, ethers.constants.HashZero], ); const flatSig = await owner.signMessage( ethers.utils.arrayify(messageToSign), @@ -1415,10 +1416,10 @@ describe("P2PIX", () => { ); }); it("should revert if ecrecovered signer is invalid", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [target, 100, ethers.constants.HashZero], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(target), 100, ethers.constants.HashZero], ); const flatSig = await acc03.signMessage( ethers.utils.arrayify(messageToSign), @@ -1462,10 +1463,10 @@ describe("P2PIX", () => { it("should release lock, update storage and emit events", async () => { const zero = ethers.constants.Zero; const endtoendID = ethers.constants.HashZero; - const pixTarget = ethers.BigNumber.from(101); + const pixTarget = ethers.BigNumber.from(101).toString(); const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [pixTarget, 100, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(pixTarget), 100, endtoendID], ); // Note: messageToSign is a string, that is 66-bytes long, to sign the // binary value, we must convert it to the 32 byte Array that @@ -1615,7 +1616,7 @@ describe("P2PIX", () => { // edge case test it("should release multiple locks", async () => { const endtoendID = ethers.constants.HashZero; - const pixTarget = ethers.BigNumber.from(101); + const pixTarget = ethers.BigNumber.from(101).toString(); const root = ethers.constants.HashZero; const acc01Key = await p2pix.callStatic._castAddrToKey( acc01.address, @@ -1630,24 +1631,24 @@ describe("P2PIX", () => { acc03Key, ); const messageToSign1 = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [pixTarget, 100, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(pixTarget), 100, endtoendID], ); const flatSig1 = await owner.signMessage( ethers.utils.arrayify(messageToSign1), ); const sig1 = ethers.utils.splitSignature(flatSig1); const messageToSign2 = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [pixTarget, 50, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(pixTarget), 50, endtoendID], ); const flatSig2 = await owner.signMessage( ethers.utils.arrayify(messageToSign2), ); const sig2 = ethers.utils.splitSignature(flatSig2); const messageToSign3 = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [pixTarget, 25, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(pixTarget), 25, endtoendID], ); const flatSig3 = await owner.signMessage( ethers.utils.arrayify(messageToSign3), @@ -1851,7 +1852,7 @@ describe("P2PIX", () => { }); describe("Unexpire Locks", async () => { it("should revert if lock isn't expired", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -1881,10 +1882,10 @@ describe("P2PIX", () => { }); it("should revert if lock has already been released", async () => { const endtoendID = ethers.constants.HashZero; - const pixTarget = ethers.BigNumber.from(101); + const pixTarget = ethers.BigNumber.from(101).toString(); const messageToSign = ethers.utils.solidityKeccak256( - ["uint160", "uint80", "bytes32"], - [pixTarget, 1, endtoendID], + ["bytes32", "uint80", "bytes32"], + [await p2pix.callStatic.getStr(pixTarget), 1, endtoendID], ); const messageHashBytes = ethers.utils.arrayify(messageToSign); @@ -1928,7 +1929,7 @@ describe("P2PIX", () => { ); }); it("should unlock expired locks, update storage and emit events", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -1992,7 +1993,7 @@ describe("P2PIX", () => { ); }); it("should unlock expired through lock function", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); // test method through lock fx await erc20.approve(p2pix.address, price); await p2pix.deposit( @@ -2068,7 +2069,7 @@ describe("P2PIX", () => { ); }); it("should unlock expired through withdraw function", async () => { - const target = ethers.constants.One; + const target = ethers.constants.One.toString(); // test method through withdraw fx await erc20.approve(p2pix.address, price); await p2pix.deposit( @@ -2110,7 +2111,7 @@ describe("P2PIX", () => { describe("Seller Withdraw", async () => { it("should revert if the wished amount is invalid", async () => { - const target = ethers.BigNumber.from(101); + const target = ethers.BigNumber.from(101).toString(); await erc20.approve(p2pix.address, price); await p2pix.deposit( erc20.address, @@ -2138,7 +2139,7 @@ describe("P2PIX", () => { const dep = await p2pix.deposit( erc20.address, price, - ethers.BigNumber.from(101), + ethers.BigNumber.from(101).toString(), true, merkleRoot, ); diff --git a/test/utils/fixtures.ts b/test/utils/fixtures.ts index 704e842..d63917b 100644 --- a/test/utils/fixtures.ts +++ b/test/utils/fixtures.ts @@ -23,7 +23,7 @@ export interface Lock { sellerKey: BigNumber; counter: BigNumber; expirationBlock: BigNumber; - pixTarget: BigNumber; + pixTarget: string; token: string; buyerAddress: string; amount: BigNumber;