🏗️
This commit is contained in:
1 parent
ecb3d3d3f0
commit
9feb38db50
33 files changed
+407
-224
No files matched your search
@@ -6,6 +6,7 @@
|
||||
|
||||
```rs
|
||||
./contracts/
|
||||
├── Constants.sol
|
||||
├── DataTypes.sol
|
||||
├── EventAndErrors.sol
|
||||
├── lib
|
||||
@@ -18,6 +19,7 @@
|
||||
│ ├── tokens
|
||||
│ │ └── ERC20.sol
|
||||
│ └── utils
|
||||
│ ├── ECDSA.sol
|
||||
│ ├── MerkleProofLib.sol
|
||||
│ ├── Multicall.sol
|
||||
│ ├── ReentrancyGuard.sol
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/249d92249de0943da88155e04b92fb7f.json"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Constants",
|
||||
"sourceName": "contracts/Constants.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../build-info/3511ccc4f632d4fc1741b59d8fb89855.json"
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
"contractName": "DataTypes",
|
||||
"sourceName": "contracts/DataTypes.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212206adb3dae064942e78abcd2b6adb116d65e8b719b79e9f02514e62a1b01f8a03b64736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea26469706673582212206adb3dae064942e78abcd2b6adb116d65e8b719b79e9f02514e62a1b01f8a03b64736f6c63430008130033",
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220e2b83942b5818cc4f73c29200b41672c082782c77a5936ed5de9e316913cd2d264736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220e2b83942b5818cc4f73c29200b41672c082782c77a5936ed5de9e316913cd2d264736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/906fc0dd8b27e18481e135d1f328d0ae.json"
|
||||
"buildInfo": "../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/b608b6eb28957aeb71328924500ce935.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/7e64ed907e656944d305af383d70ed0c.json"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ECDSA",
|
||||
"sourceName": "contracts/lib/utils/ECDSA.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSignature",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/6c3e670658cfbeb3de636ecbaa8ad53a.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/b608b6eb28957aeb71328924500ce935.json"
|
||||
"buildInfo": "../../build-info/249d92249de0943da88155e04b92fb7f.json"
|
||||
}
|
||||
@@ -404,19 +404,6 @@
|
||||
"name": "ValidSignersUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "WAD",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@@ -658,14 +645,14 @@
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"internalType": "uint80",
|
||||
"name": "_relayerPremium",
|
||||
"type": "uint256"
|
||||
"type": "uint80"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"internalType": "uint80",
|
||||
"name": "_amount",
|
||||
"type": "uint256"
|
||||
"type": "uint80"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
@@ -682,7 +669,7 @@
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"name": "lockID",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
@@ -722,16 +709,6 @@
|
||||
"name": "counter",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "relayerPremium",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "expirationBlock",
|
||||
@@ -742,6 +719,16 @@
|
||||
"name": "pixTarget",
|
||||
"type": "uint160"
|
||||
},
|
||||
{
|
||||
"internalType": "uint80",
|
||||
"name": "relayerPremium",
|
||||
"type": "uint80"
|
||||
},
|
||||
{
|
||||
"internalType": "uint80",
|
||||
"name": "amount",
|
||||
"type": "uint80"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "buyerAddress",
|
||||
@@ -1074,8 +1061,8 @@
|
||||
"type": "receive"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405262002a0f803803806200001781620000ce565b928339810160a082820312620000b357815160208301516001600160401b039391929190848111620000b357826200005191830162000124565b604082015191620000628362000112565b6060810151868111620000b357846200007d91830162000124565b936080820151968711620000b357620000a3966200009c920162000193565b93620001fa565b6040516125d99081620004368239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b03811183821017620000f457604052565b620000b8565b6001600160401b038111620000f45760051b60200190565b6001600160a01b03811603620000b357565b9080601f83011215620000b357815190620001496200014383620000fa565b620000ce565b9182938184526020808095019260051b820101928311620000b3578301905b82821062000177575050505090565b8380918351620001878162000112565b81520191019062000168565b9080601f83011215620000b357815190620001b26200014383620000fa565b9182938184526020808095019260051b820101928311620000b3578301905b828210620001e0575050505090565b81518015158103620000b3578152908301908301620001d1565b600080546001600160a01b03191633908117825591969594939291817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3600191828055876003556040519788527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208099a160028490556040516001600160a01b0394851681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f908990a18051818901989060051b820181013d15158a5b811562000339575b505050604051948186019282875251809352604086019993905b8382106200032157505050505050807f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7916200031f95960390a162000373565b565b845181168b52998201999382019390850190620002df565b908382600182979896949e999e51600c1b55019083821015620003655791509a959a94939294620002bd565b509a959a94939294620002c5565b60008054919290916001600160a01b03163303620004245782519182156200041757815183036200040a57602092919284818080970195019360051b0101925b838103620003c2575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003b3565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b6040516282b42960e81b8152600490fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102165780630d2a2d441461021157806313af40351461020c578063328a718114610207578063367821f014610202578063461f3120146101b257806349ef8448146101fd5780634b2ae980146101f8578063574983c8146101f35780635fd8c710146101ee57806369cc6af4146101e95780636a146024146101e45780636d82d9e0146101df57806377cd38a4146101da5780637f94f65d146101d557806380e1d302146101d057806384ab1d28146101cb5780638a006225146101c65780638da5cb5b146101c15780638db564c2146101bc5780639872dbfe146101b757806398a26871146101b25780639eee8d4b146101ad578063ad8f2eed146101a8578063b0983d39146101a3578063c52164c61461019e578063c593dfd814610199578063d1c0702814610194578063d4fac45d1461018f578063d6e8b9731461018a578063f7d0e04b146101855763fb8c5ef00361000e576115af565b61153f565b611494565b61147b565b6113d9565b610f4a565b610f16565b610edc565b610e86565b610e46565b610835565b610e28565b610e0a565b610dd6565b610d3d565b610cd6565b610cbd565b610c6c565b610c34565b610b23565b610b00565b610ac0565b610a3d565b6109d9565b6109af565b610918565b610786565b610556565b6104a8565b61037b565b346102425760206003193601126102425760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102b757604052565b610247565b60405190610120820182811067ffffffffffffffff8211176102b757604052565b67ffffffffffffffff81116102b75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361024257565b81601f820112156102425780359161032a836102dd565b926103386040519485610276565b808452602092838086019260051b820101928311610242578301905b828210610362575050505090565b8380918335610370816102f5565b815201910190610354565b34610242576020806003193601126102425760043567ffffffffffffffff8111610242576103ad903690600401610313565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361047e57805181830192849160051b830181013d1515855b811561044a575b50505060405192818401908285525180915260408401949160005b828110610434577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610405565b90838260018298969499979951600c1b550190838210156104725791509593959492946103e3565b509593959492946103ea565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610242576020600319360112610242576004356104c5816102f5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361047e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361024257565b3590811515820361024257565b346102425760a060031936011261024257600435610573816102f5565b6024356bffffffffffffffffffffffff81Line truncated
|
||||
"deployedBytecode": "0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102165780630d2a2d441461021157806313af40351461020c578063328a718114610207578063367821f014610202578063461f3120146101b257806349ef8448146101fd5780634b2ae980146101f8578063574983c8146101f35780635fd8c710146101ee57806369cc6af4146101e95780636a146024146101e45780636d82d9e0146101df57806377cd38a4146101da5780637f94f65d146101d557806380e1d302146101d057806384ab1d28146101cb5780638a006225146101c65780638da5cb5b146101c15780638db564c2146101bc5780639872dbfe146101b757806398a26871146101b25780639eee8d4b146101ad578063ad8f2eed146101a8578063b0983d39146101a3578063c52164c61461019e578063c593dfd814610199578063d1c0702814610194578063d4fac45d1461018f578063d6e8b9731461018a578063f7d0e04b146101855763fb8c5ef00361000e576115af565b61153f565b611494565b61147b565b6113d9565b610f4a565b610f16565b610edc565b610e86565b610e46565b610835565b610e28565b610e0a565b610dd6565b610d3d565b610cd6565b610cbd565b610c6c565b610c34565b610b23565b610b00565b610ac0565b610a3d565b6109d9565b6109af565b610918565b610786565b610556565b6104a8565b61037b565b346102425760206003193601126102425760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102b757604052565b610247565b60405190610120820182811067ffffffffffffffff8211176102b757604052565b67ffffffffffffffff81116102b75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361024257565b81601f820112156102425780359161032a836102dd565b926103386040519485610276565b808452602092838086019260051b820101928311610242578301905b828210610362575050505090565b8380918335610370816102f5565b815201910190610354565b34610242576020806003193601126102425760043567ffffffffffffffff8111610242576103ad903690600401610313565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361047e57805181830192849160051b830181013d1515855b811561044a575b50505060405192818401908285525180915260408401949160005b828110610434577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610405565b90838260018298969499979951600c1b550190838210156104725791509593959492946103e3565b509593959492946103ea565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610242576020600319360112610242576004356104c5816102f5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361047e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361024257565b3590811515820361024257565b346102425760a060031936011261024257600435610573816102f5565b6024356bffffffffffffffffffffffff811690818103610242576044359061059a826102f5565b6105a261053a565b6084359373ffffffffffffffffffffffffffffffffffffffff8087169033600c1b9086161561075c576105ea6105e68363cbc9d1c4600c526000526020600c205490565b1590565b610732576b3fffffffffffffffffffffff61061b83839060205263739094b1600c52600c1c6000526034600c205490565b16906a52b7d2dcc80cd2e4000000610633858461170a565b1161070857826106f3976106ad9661067f896106a4967f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf9d610673611717565b806106f8575b5061170a565b9060ff1b91605f1b1717919060205263739094b1600c52600c1c6000526034600c2055565b30903390611752565b6106b660018055565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2005b6107029033611e53565b38610679565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b3461024257602060031936011261024257600480356000908152600560208181526040928390208054600182015460028301546003840154978401549584015460068501546007860154600890960154895195865296850193909352968301526060820196909652608081019390935273ffffffffffffffffffffffffffffffffffffffff93841660a084015293831660c083015292821660e0820152911661010082015261012090f35b0390f35b34610242576020600319360112610242576020600435546040519015158152f35b90815180825260208080930193019160005b828110610876575050505090565b835185529381019392810192600101610868565b9061089d90604083526040830190610856565b81810360209283015282518082529082019282019160009190825b8281106108c757505050505090565b909192939485516004808210156108ec575081528201948201939291906001016108b8565b8660216024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b34610242576020806003193601126102425760043567ffffffffffffffff8111610242573660238201121561024257806004013590610956826102dd565b916109646040519384610276565b80835260248484019160051b8301019136831161024257602401905b8282106109a0576109908461245d565b906108316040519283928361088a565b81358152908401908401610980565b34610242576020Line truncated
|
||||
"bytecode": "0x608060405262002c24803803806200001781620000ce565b928339810160a082820312620000b357815160208301516001600160401b039391929190848111620000b357826200005191830162000124565b604082015191620000628362000112565b6060810151868111620000b357846200007d91830162000124565b936080820151968711620000b357620000a3966200009c920162000193565b93620001fa565b6040516127ee9081620004368239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b03811183821017620000f457604052565b620000b8565b6001600160401b038111620000f45760051b60200190565b6001600160a01b03811603620000b357565b9080601f83011215620000b357815190620001496200014383620000fa565b620000ce565b9182938184526020808095019260051b820101928311620000b3578301905b82821062000177575050505090565b8380918351620001878162000112565b81520191019062000168565b9080601f83011215620000b357815190620001b26200014383620000fa565b9182938184526020808095019260051b820101928311620000b3578301905b828210620001e0575050505090565b81518015158103620000b3578152908301908301620001d1565b600080546001600160a01b03191633908117825591969594939291817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3600191828055876003556040519788527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208099a160028490556040516001600160a01b0394851681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f908990a18051818901989060051b820181013d15158a5b811562000339575b505050604051948186019282875251809352604086019993905b8382106200032157505050505050807f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7916200031f95960390a162000373565b565b845181168b52998201999382019390850190620002df565b908382600182979896949e999e51600c1b55019083821015620003655791509a959a94939294620002bd565b509a959a94939294620002c5565b60008054919290916001600160a01b03163303620004245782519182156200041757815183036200040a57602092919284818080970195019360051b0101925b838103620003c2575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003b3565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b6040516282b42960e81b8152600490fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc5780632cc0f905146101f7578063328a7181146101f2578063367821f0146101ed578063461f3120146101a757806349ef8448146101e85780634b2ae980146101e3578063574983c8146101de5780635fd8c710146101d957806369cc6af4146101d45780636d82d9e0146101cf57806377cd38a4146101ca5780637f94f65d146101c557806380e1d302146101c057806384ab1d28146101bb5780638da5cb5b146101b65780638db564c2146101b15780639872dbfe146101ac57806398a26871146101a75780639eee8d4b146101a2578063ad8f2eed1461019d578063b0983d3914610198578063c52164c614610193578063c593dfd81461018e578063d1c0702814610189578063d4fac45d14610184578063d6e8b9731461017f578063f7d0e04b1461017a5763fb8c5ef00361000e57611678565b611608565b61155d565b611544565b6114a2565b610f64565b610f30565b610ef6565b610ea0565b610e60565b61093c565b610e42565b610e24565b610df0565b610dba565b610da1565b610d50565b610d18565b610c07565b610bc7565b610b44565b610ae0565b610ab6565b610a1f565b610881565b610651565b61058d565b610498565b61036b565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b60405190610120820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f820112156102325780359161031a836102cd565b926103286040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610352575050505090565b8380918335610360816102e5565b815201910190610344565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039d903690600401610303565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046e57805181830192849160051b830181013d1515855b811561043a575b50505060405192818401908285525180915260408401949160005b828110610424577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f5565b90838260018298969499979951600c1b550190838210156104625791509593959492946103d3565b509593959492946103da565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b5816102e5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b6064359069ffffffffffffffffffff8216820361023257565b6084359069ffffffffffffffffffff8216820361023257565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051bLine truncated
|
||||
"deployedBytecode": "0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc5780632cc0f905146101f7578063328a7181146101f2578063367821f0146101ed578063461f3120146101a757806349ef8448146101e85780634b2ae980146101e3578063574983c8146101de5780635fd8c710146101d957806369cc6af4146101d45780636d82d9e0146101cf57806377cd38a4146101ca5780637f94f65d146101c557806380e1d302146101c057806384ab1d28146101bb5780638da5cb5b146101b65780638db564c2146101b15780639872dbfe146101ac57806398a26871146101a75780639eee8d4b146101a2578063ad8f2eed1461019d578063b0983d3914610198578063c52164c614610193578063c593dfd81461018e578063d1c0702814610189578063d4fac45d14610184578063d6e8b9731461017f578063f7d0e04b1461017a5763fb8c5ef00361000e57611678565b611608565b61155d565b611544565b6114a2565b610f64565b610f30565b610ef6565b610ea0565b610e60565b61093c565b610e42565b610e24565b610df0565b610dba565b610da1565b610d50565b610d18565b610c07565b610bc7565b610b44565b610ae0565b610ab6565b610a1f565b610881565b610651565b61058d565b610498565b61036b565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b60405190610120820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f820112156102325780359161031a836102cd565b926103286040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610352575050505090565b8380918335610360816102e5565b815201910190610344565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039d903690600401610303565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046e57805181830192849160051b830181013d1515855b811561043a575b50505060405192818401908285525180915260408401949160005b828110610424577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f5565b90838260018298969499979951600c1b550190838210156104625791509593959492946103d3565b509593959492946103da565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b5816102e5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b6064359069ffffffffffffffffffff8216820361023257565b6084359069ffffffffffffffffffff8216820361023257565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051b01011161023257565b346102325760e0600319360112610232576004356105aa816102e5565b602435906105b7826102e5565b604435916105c4836102e5565b6105cc61052a565b916105d5610543565b67ffffffffffffffff9360a435858111610232576105f790369060040161055c565b92909160c435968711610232576106319761061961062198369060040161055c565b979096611927565b6040519081529081906020820190565b0390f35b60643590811515820361023257565b3590811515820361023257565b346102325760a06003193601126102325760043561066e816102e5565b6024356bffffffffffffffffffffffff8116908181036102325760443590610695826102e5565b61069d610635565b6084359373ffffffffffffffffffffffffffffffffffffffff8087169033600c1b90861615610857576106e56106e18363cbc9d1c4600c526000526020600c205490565b1590565b61082d576b3fffffffffffffffffffffff61071683839060205263739094b1600c52600c1c6000526034600c205490565b16906a52b7d2dcc80cd2e400000061072e85846117ce565b1161080357826107ee976107a89661077a8961079f967f63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf9d61076e6117db565b806107f3575b506117ce565b9060ff1b91605f1b1717919060205263739094b1600c52600c1c6000526034600c2055565b30903390611816565b6107b160018055565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526bffffffffffffffffffffffff90911660208501523393918291820190565b0390a2005b6107fd9033611fc7565b38610774565b60046040517ff3fb0eb9000000000000000000000000000000000000000000000000000000008152fd5b60046040517f1578328e000000000000000000000000000000000000000000000000000000008152fd5b60046040517f6a3bc53e000000000000000000000000000000000000000000000000000000008152fd5b346102325760206003193601126102325760048035600090815260056020818152604092839020805460018201546002830154600384015497840154958401546006909401548751938452948301919091529481019490945273ffffffffffffffffffffffffffffffffffffffff808616606086015269ffffffffffffffffffff60a096871c8116608087015284169585019590955260509290921c841660c084015290831660e08301529190911661010082015261012090f35b34610232576020600319360112610232576020600435546040519015158152f35b90815180825260208080930193019160005b82811061097d575050505090565b83518552938101939281019260010161096f565b906109a49060408352604083019061095d565b818103602092830152825180825290820192Line truncated
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
abstract contract Constants {
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
uint256 constant _ROOT_UPDATED_EVENT_SIGNATURE =
|
||||
0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632;
|
||||
uint256 constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE =
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a;
|
||||
|
||||
/// @dev Seller casted to key => Seller's allowlist merkleroot.
|
||||
/// mapping(uint256 => bytes32) public sellerAllowList;
|
||||
uint256 constant _SELLER_ALLOWLIST_SLOT_SEED = 0x74dfee70;
|
||||
/// @dev Tokens allowed to serve as the underlying amount of a deposit.
|
||||
/// mapping(ERC20 => bool) public allowedERC20s;
|
||||
uint256 constant _ALLOWED_ERC20_SLOT_SEED = 0xcbc9d1c4;
|
||||
|
||||
/// @dev `balance` max. value = 10**26.
|
||||
/// @dev `pixTarget` keys are restricted to 160 bits.
|
||||
/// mapping(uint256 => mapping(ERC20 => uint256)) public sellerBalance;
|
||||
|
||||
/// @dev Bits layout:
|
||||
/// `uint96` [0...94] := balance
|
||||
/// `uint160` [95...254] := pixTarget
|
||||
/// `bool` [255] := valid
|
||||
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// mstore(0x20, token)
|
||||
/// mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
/// mstore(0x00, seller)
|
||||
/// let value := sload(keccak256(0x0c, 0x34)).
|
||||
uint256 constant _SELLER_BALANCE_SLOT_SEED = 0x739094b1;
|
||||
|
||||
/// @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;
|
||||
/// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one.
|
||||
uint256 constant BITMASK_VALID = (1 << 255) - 1;
|
||||
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 constant WAD = 1e18;
|
||||
uint256 constant MAXBALANCE_UPPERBOUND = 1e8 ether;
|
||||
uint256 constant REPUTATION_LOWERBOUND = 1e2 ether;
|
||||
uint256 constant LOCKAMOUNT_UPPERBOUND = 1e6 ether;
|
||||
}
|
||||
@@ -5,14 +5,14 @@ library DataTypes {
|
||||
struct Lock {
|
||||
uint256 sellerKey;
|
||||
uint256 counter;
|
||||
/// @dev Amount to be paid for relayer.
|
||||
uint256 relayerPremium;
|
||||
/// @dev Amount to be tranfered via PIX.
|
||||
uint256 amount;
|
||||
/// @dev If not paid at this block will be expired.
|
||||
uint256 expirationBlock;
|
||||
uint160 pixTarget;
|
||||
/// @dev Amount to be paid for relayer.
|
||||
uint80 relayerPremium;
|
||||
/// @dev Where the tokens are sent the when order gets validated.
|
||||
/// @dev Amount to be tranfered via PIX.
|
||||
uint80 amount;
|
||||
address buyerAddress;
|
||||
/// @dev Relayer address (msg.sender) that facilitated this transaction.
|
||||
/// @dev Relayer's target address that receives `relayerPremium` funds.
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.8.4;
|
||||
|
||||
/// @notice Gas optimized ECDSA wrapper.
|
||||
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)
|
||||
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)
|
||||
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)
|
||||
library ECDSA {
|
||||
/// @dev The signature is invalid.
|
||||
error InvalidSignature();
|
||||
|
||||
/// @dev The number which `s` must not exceed in order for
|
||||
/// the signature to be non-malleable.
|
||||
bytes32 private constant _MALLEABILITY_THRESHOLD =
|
||||
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0;
|
||||
|
||||
/// @dev Recovers the signer's address from a message digest `hash`,
|
||||
/// and the signature defined by `v`, `r`, `s`.
|
||||
function recover(
|
||||
bytes32 hash,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) internal view returns (address result) {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Copy the free memory pointer so that we can restore it later.
|
||||
let m := mload(0x40)
|
||||
mstore(0x00, hash)
|
||||
mstore(0x20, and(v, 0xff))
|
||||
mstore(0x40, r)
|
||||
mstore(0x60, s)
|
||||
pop(
|
||||
staticcall(
|
||||
gas(), // Amount of gas left for the transaction.
|
||||
// If `s` in lower half order, such that the signature is not malleable.
|
||||
lt(s, add(_MALLEABILITY_THRESHOLD, 1)), // Address of `ecrecover`.
|
||||
0x00, // Start of input.
|
||||
0x80, // Size of input.
|
||||
0x00, // Start of output.
|
||||
0x20 // Size of output.
|
||||
)
|
||||
)
|
||||
result := mload(0x00)
|
||||
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
|
||||
if iszero(returndatasize()) {
|
||||
// Store the function selector of `InvalidSignature()`.
|
||||
mstore(0x00, 0x8baa579f)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// Restore the zero slot.
|
||||
mstore(0x60, 0)
|
||||
// Restore the free memory pointer.
|
||||
mstore(0x40, m)
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Returns an Ethereum Signed Message, created from a `hash`.
|
||||
/// This produces a hash corresponding to the one signed with the
|
||||
/// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
|
||||
/// JSON-RPC method as part of EIP-191.
|
||||
function toEthSignedMessageHash(
|
||||
bytes32 hash
|
||||
) internal pure returns (bytes32 result) {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Store into scratch space for keccak256.
|
||||
mstore(0x20, hash)
|
||||
mstore(
|
||||
0x00,
|
||||
"\x00\x00\x00\x00\x19Ethereum Signed Message:\n32"
|
||||
)
|
||||
// 0x40 - 0x04 = 0x3c
|
||||
result := keccak256(0x04, 0x3c)
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
-116
@@ -12,11 +12,15 @@ import { Owned } from "./lib/auth/Owned.sol";
|
||||
import { ERC20, SafeTransferLib } from "./lib/utils/SafeTransferLib.sol";
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
import { MerkleProofLib as Merkle } from "./lib/utils/MerkleProofLib.sol";
|
||||
import { ECDSA } from "./lib/utils/ECDSA.sol";
|
||||
import { ReentrancyGuard } from "./lib/utils/ReentrancyGuard.sol";
|
||||
import { EventAndErrors } from "./EventAndErrors.sol";
|
||||
import { DataTypes as DT } from "./DataTypes.sol";
|
||||
import { Constants } from "./Constants.sol";
|
||||
|
||||
|
||||
contract P2PIX is
|
||||
Constants,
|
||||
EventAndErrors,
|
||||
Owned(msg.sender),
|
||||
ReentrancyGuard
|
||||
@@ -28,53 +32,17 @@ contract P2PIX is
|
||||
using DT for DT.Lock;
|
||||
using DT for DT.LockStatus;
|
||||
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
uint256 private constant _ROOT_UPDATED_EVENT_SIGNATURE =
|
||||
0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632;
|
||||
uint256 private constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE =
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a;
|
||||
|
||||
/// @dev Seller casted to key => Seller's allowlist merkleroot.
|
||||
/// mapping(uint256 => bytes32) public sellerAllowList;
|
||||
uint256 private constant _SELLER_ALLOWLIST_SLOT_SEED = 0x74dfee70;
|
||||
/// @dev Tokens allowed to serve as the underlying amount of a deposit.
|
||||
/// mapping(ERC20 => bool) public allowedERC20s;
|
||||
uint256 private constant _ALLOWED_ERC20_SLOT_SEED = 0xcbc9d1c4;
|
||||
|
||||
// BITS LAYOUT
|
||||
// `uint96` [0...94] := balance
|
||||
// `uint160` [95...254] := pixTarget
|
||||
// `bool` [255] := valid
|
||||
|
||||
/// @dev `balance` max. value = 10**26.
|
||||
/// @dev `pixTarget` keys are restricted to 160 bits.
|
||||
// mapping(uint256 => mapping(ERC20 => uint256)) public sellerBalance;
|
||||
uint256 private constant _SELLER_BALANCE_SLOT_SEED = 0x739094b1;
|
||||
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 private constant BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
/// @dev The bit position of `pixTarget` in `sellerBalance`.
|
||||
uint256 private constant BITPOS_PIXTARGET = 95;
|
||||
/// @dev The bit position of `valid` in `sellerBalance`.
|
||||
uint256 private constant BITPOS_VALID = 255;
|
||||
/// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one.
|
||||
uint256 private constant BITMASK_VALID = (1 << 255) - 1;
|
||||
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 public constant WAD = 1e18;
|
||||
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev List of valid Bacen signature addresses
|
||||
/// mapping(uint256 => bool) public validBacenSigners;
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// let slot := sload(shl(12, address)).
|
||||
// mapping(uint256 => bool) public validBacenSigners;
|
||||
/// let value := sload(shl(12, address)).
|
||||
|
||||
/// @dev List of Pix transactions already signed.
|
||||
/// mapping(bytes32 => bool) public usedTransactions;
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// let slot := sload(bytes32).
|
||||
// mapping(bytes32 => bool) public usedTransactions;
|
||||
/// let value := sload(bytes32).
|
||||
|
||||
IReputation public reputation;
|
||||
|
||||
@@ -126,7 +94,7 @@ contract P2PIX is
|
||||
uint256 _sellerBalance = sellerBalance(k,t);
|
||||
|
||||
uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY;
|
||||
if ((currBal + _amount) > 1e8 ether)
|
||||
if ((currBal + _amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
setReentrancyGuard();
|
||||
@@ -210,12 +178,11 @@ contract P2PIX is
|
||||
address _seller,
|
||||
address _token,
|
||||
address _buyerAddress,
|
||||
// address _relayerTarget,
|
||||
uint256 _relayerPremium,
|
||||
uint256 _amount,
|
||||
uint80 _relayerPremium,
|
||||
uint80 _amount,
|
||||
bytes32[] calldata merkleProof,
|
||||
uint256[] calldata expiredLocks
|
||||
) public nonReentrant returns (uint256) {
|
||||
) public nonReentrant returns (uint256 lockID) {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
ERC20 t = ERC20(_token);
|
||||
@@ -235,58 +202,32 @@ contract P2PIX is
|
||||
DT.Lock memory l = DT.Lock(
|
||||
k,
|
||||
cCounter,
|
||||
_relayerPremium,
|
||||
_amount,
|
||||
(block.number + defaultLockBlocks),
|
||||
uint160(sellerBalance(k, t) >> BITPOS_PIXTARGET),
|
||||
_relayerPremium,
|
||||
_amount,
|
||||
_buyerAddress,
|
||||
// _relayerTarget,
|
||||
msg.sender,
|
||||
address(t)
|
||||
);
|
||||
|
||||
if (merkleProof.length != 0) {
|
||||
_merkleVerify(
|
||||
merkleProof,
|
||||
sellerAllowList(k),
|
||||
msg.sender
|
||||
);
|
||||
_merkleVerify( merkleProof, sellerAllowList(k), msg.sender);
|
||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
} else {
|
||||
if (l.amount <= 1e2 ether) {
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
if (l.amount <= REPUTATION_LOWERBOUND) {
|
||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
} else {
|
||||
uint256 userCredit = userRecord[_castAddrToKey(msg.sender)];
|
||||
uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD);
|
||||
if (
|
||||
l.amount > (spendLimit * WAD) || l.amount > LOCKAMOUNT_UPPERBOUND
|
||||
) revert AmountNotAllowed();
|
||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
} else {
|
||||
uint256 userCredit = userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
];
|
||||
|
||||
uint256 spendLimit;
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
|
||||
if (
|
||||
l.amount > (spendLimit * WAD) ||
|
||||
l.amount > 1e6 ether
|
||||
) revert AmountNotAllowed();
|
||||
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
}
|
||||
}
|
||||
/* */}/* */}
|
||||
}
|
||||
|
||||
/// @notice Lock release method that liquidate lock
|
||||
@@ -294,7 +235,7 @@ contract P2PIX is
|
||||
/// @dev This method can be called by any public actor
|
||||
/// as long the signature provided is valid.
|
||||
/// @dev `relayerPremium` gets splitted equaly
|
||||
/// if `relayerTarget` addresses differ.
|
||||
/// if relayer addresses differ.
|
||||
/// @dev If the `msg.sender` of this method and `l.relayerAddress` are the same,
|
||||
/// `msg.sender` accrues both l.amount and l.relayerPremium as userRecord credit.
|
||||
/// In case of they differing:
|
||||
@@ -303,7 +244,6 @@ contract P2PIX is
|
||||
/// @dev Function sighash: 0x4e1389ed.
|
||||
function release(
|
||||
uint256 lockID,
|
||||
// address _relayerTarget,
|
||||
bytes32 pixTimestamp,
|
||||
bytes32 r,
|
||||
bytes32 s,
|
||||
@@ -322,22 +262,13 @@ contract P2PIX is
|
||||
pixTimestamp
|
||||
)
|
||||
);
|
||||
bytes32 messageDigest = keccak256(
|
||||
abi.encodePacked(
|
||||
"\x19Ethereum Signed Message:\n32",
|
||||
message
|
||||
)
|
||||
);
|
||||
|
||||
if (usedTransactions(message) == true)
|
||||
revert TxAlreadyUsed();
|
||||
if (usedTransactions(message)) revert TxAlreadyUsed();
|
||||
|
||||
uint256 signer = _castAddrToKey(
|
||||
ecrecover(messageDigest, v, r, s)
|
||||
);
|
||||
|
||||
if (!validBacenSigners(signer))
|
||||
revert InvalidSigner();
|
||||
if (!validBacenSigners(_castAddrToKey(
|
||||
ECDSA.recover(
|
||||
ECDSA.toEthSignedMessageHash(message), v, r, s)
|
||||
))) revert InvalidSigner();
|
||||
|
||||
ERC20 t = ERC20(l.token);
|
||||
|
||||
@@ -410,7 +341,7 @@ contract P2PIX is
|
||||
|
||||
uint256 _sellerBalance = sellerBalance(l.sellerKey, ERC20(l.token)) & BITMASK_SB_ENTRY;
|
||||
|
||||
if ((_sellerBalance + l.amount) > 1e8 ether)
|
||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
_addSellerBalance(l.sellerKey, ERC20(l.token), l.amount);
|
||||
@@ -423,8 +354,8 @@ contract P2PIX is
|
||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||
1);
|
||||
|
||||
if (_newUserRecord <= 1e2 ether) {
|
||||
userRecord[userKey] = 1e2 ether;
|
||||
if (_newUserRecord <= REPUTATION_LOWERBOUND) {
|
||||
userRecord[userKey] = REPUTATION_LOWERBOUND;
|
||||
} else {
|
||||
userRecord[userKey] = _newUserRecord;
|
||||
}
|
||||
@@ -455,9 +386,8 @@ contract P2PIX is
|
||||
) public nonReentrant {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
if (getValid(msg.sender, token) == true) {
|
||||
if (getValid(msg.sender, token))
|
||||
setValidState(token, false);
|
||||
}
|
||||
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
_decBal(
|
||||
@@ -623,10 +553,12 @@ contract P2PIX is
|
||||
DT.Lock memory _l,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) internal {
|
||||
) internal returns(uint256 counter){
|
||||
mapLocks[_lockID] = _l;
|
||||
|
||||
_decBal(_bal, _amount, _t, _k);
|
||||
lockCounter++;
|
||||
counter = _lockID;
|
||||
|
||||
emit LockAdded(
|
||||
_l.buyerAddress,
|
||||
@@ -655,16 +587,11 @@ contract P2PIX is
|
||||
view
|
||||
returns (uint256 _spendLimit)
|
||||
{
|
||||
// enconde the fx sighash and args
|
||||
bytes memory encodedParams = abi.encodeWithSelector(
|
||||
IReputation.limiter.selector,
|
||||
_userCredit
|
||||
);
|
||||
// cast the uninitialized return values to memory
|
||||
bool success;
|
||||
// uint256 returnSize;
|
||||
// uint256 returnValue;
|
||||
// perform staticcall from the stack w yul
|
||||
assembly {
|
||||
success := staticcall(
|
||||
// gas
|
||||
@@ -680,11 +607,7 @@ contract P2PIX is
|
||||
// retSize
|
||||
0x20
|
||||
)
|
||||
// returnSize := returndatasize()
|
||||
// returnValue := mload(0x00)
|
||||
// _spendLimit := returnValue
|
||||
_spendLimit := mload(0x00)
|
||||
// reverts if call does not succeed.
|
||||
if iszero(success) {
|
||||
// StaticCallFailed()
|
||||
mstore(0x00, 0xe10bf1cc)
|
||||
|
||||
@@ -113,10 +113,16 @@ const config: HardhatUserConfig = {
|
||||
version: "0.8.19",
|
||||
settings: {
|
||||
viaIR: true,
|
||||
evmVersion: "paris",
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 20_000,
|
||||
details: {
|
||||
deduplicate: true,
|
||||
cse: true,
|
||||
constantOptimizer: true,
|
||||
peephole: true,
|
||||
jumpdestRemover: true,
|
||||
yul: true,
|
||||
yulDetails: {
|
||||
stackAllocation: true,
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
|
||||
import type { Provider, TransactionRequest } from "@ethersproject/providers";
|
||||
import type { PromiseOrValue } from "../../../common";
|
||||
import type { ECDSA, ECDSAInterface } from "../../../lib/utils/ECDSA";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSignature",
|
||||
type: "error",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033";
|
||||
|
||||
type ECDSAConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: ECDSAConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class ECDSA__factory extends ContractFactory {
|
||||
constructor(...args: ECDSAConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ECDSA> {
|
||||
return super.deploy(overrides || {}) as Promise<ECDSA>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): ECDSA {
|
||||
return super.attach(address) as ECDSA;
|
||||
}
|
||||
override connect(signer: Signer): ECDSA__factory {
|
||||
return super.connect(signer) as ECDSA__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): ECDSAInterface {
|
||||
return new utils.Interface(_abi) as ECDSAInterface;
|
||||
}
|
||||
static connect(address: string, signerOrProvider: Signer | Provider): ECDSA {
|
||||
return new Contract(address, _abi, signerOrProvider) as ECDSA;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { ECDSA__factory } from "./ECDSA__factory";
|
||||
export { Multicall__factory } from "./Multicall__factory";
|
||||
export { ReentrancyGuard__factory } from "./ReentrancyGuard__factory";
|
||||
export { SafeTransferLib__factory } from "./SafeTransferLib__factory";
|
||||
@@ -415,19 +415,6 @@ const _abi = [
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "WAD",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
@@ -669,14 +656,14 @@ const _abi = [
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
internalType: "uint80",
|
||||
name: "_relayerPremium",
|
||||
type: "uint256",
|
||||
type: "uint80",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
internalType: "uint80",
|
||||
name: "_amount",
|
||||
type: "uint256",
|
||||
type: "uint80",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
@@ -693,7 +680,7 @@ const _abi = [
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
@@ -733,16 +720,6 @@ const _abi = [
|
||||
name: "counter",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "relayerPremium",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "expirationBlock",
|
||||
@@ -753,6 +730,16 @@ const _abi = [
|
||||
name: "pixTarget",
|
||||
type: "uint160",
|
||||
},
|
||||
{
|
||||
internalType: "uint80",
|
||||
name: "relayerPremium",
|
||||
type: "uint80",
|
||||
},
|
||||
{
|
||||
internalType: "uint80",
|
||||
name: "amount",
|
||||
type: "uint80",
|
||||
},
|
||||
{
|
||||
internalType: "address",
|
||||
name: "buyerAddress",
|
||||
@@ -1087,7 +1074,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x608060405262002a0f803803806200001781620000ce565b928339810160a082820312620000b357815160208301516001600160401b039391929190848111620000b357826200005191830162000124565b604082015191620000628362000112565b6060810151868111620000b357846200007d91830162000124565b936080820151968711620000b357620000a3966200009c920162000193565b93620001fa565b6040516125d99081620004368239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b03811183821017620000f457604052565b620000b8565b6001600160401b038111620000f45760051b60200190565b6001600160a01b03811603620000b357565b9080601f83011215620000b357815190620001496200014383620000fa565b620000ce565b9182938184526020808095019260051b820101928311620000b3578301905b82821062000177575050505090565b8380918351620001878162000112565b81520191019062000168565b9080601f83011215620000b357815190620001b26200014383620000fa565b9182938184526020808095019260051b820101928311620000b3578301905b828210620001e0575050505090565b81518015158103620000b3578152908301908301620001d1565b600080546001600160a01b03191633908117825591969594939291817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3600191828055876003556040519788527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208099a160028490556040516001600160a01b0394851681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f908990a18051818901989060051b820181013d15158a5b811562000339575b505050604051948186019282875251809352604086019993905b8382106200032157505050505050807f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7916200031f95960390a162000373565b565b845181168b52998201999382019390850190620002df565b908382600182979896949e999e51600c1b55019083821015620003655791509a959a94939294620002bd565b509a959a94939294620002c5565b60008054919290916001600160a01b03163303620004245782519182156200041757815183036200040a57602092919284818080970195019360051b0101925b838103620003c2575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003b3565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b6040516282b42960e81b8152600490fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102165780630d2a2d441461021157806313af40351461020c578063328a718114610207578063367821f014610202578063461f3120146101b257806349ef8448146101fd5780634b2ae980146101f8578063574983c8146101f35780635fd8c710146101ee57806369cc6af4146101e95780636a146024146101e45780636d82d9e0146101df57806377cd38a4146101da5780637f94f65d146101d557806380e1d302146101d057806384ab1d28146101cb5780638a006225146101c65780638da5cb5b146101c15780638db564c2146101bc5780639872dbfe146101b757806398a26871146101b25780639eee8d4b146101ad578063ad8f2eed146101a8578063b0983d39146101a3578063c52164c61461019e578063c593dfd814610199578063d1c0702814610194578063d4fac45d1461018f578063d6e8b9731461018a578063f7d0e04b146101855763fb8c5ef00361000e576115af565b61153f565b611494565b61147b565b6113d9565b610f4a565b610f16565b610edc565b610e86565b610e46565b610835565b610e28565b610e0a565b610dd6565b610d3d565b610cd6565b610cbd565b610c6c565b610c34565b610b23565b610b00565b610ac0565b610a3d565b6109d9565b6109af565b610918565b610786565b610556565b6104a8565b61037b565b346102425760206003193601126102425760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102b757604052565b610247565b60405190610120820182811067ffffffffffffffff8211176102b757604052565b67ffffffffffffffff81116102b75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361024257565b81601f820112156102425780359161032a836102dd565b926103386040519485610276565b808452602092838086019260051b820101928311610242578301905b828210610362575050505090565b8380918335610370816102f5565b815201910190610354565b34610242576020806003193601126102425760043567ffffffffffffffff8111610242576103ad903690600401610313565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361047e57805181830192849160051b830181013d1515855b811561044a575b50505060405192818401908285525180915260408401949160005b828110610434577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b8351851687529581019592810192600101610405565b90838260018298969499979951600c1b550190838210156104725791509593959492946103e3565b509593959492946103ea565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610242576020600319360112610242576004356104c5816102f5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361047e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b60643590811515820361024257565b3590811515820361024257565b346102425760a060031936011261024257600435610573816102f5565b6024356bffffffffffffffffffffffff81169081810361Line truncated
|
||||
"0x608060405262002c24803803806200001781620000ce565b928339810160a082820312620000b357815160208301516001600160401b039391929190848111620000b357826200005191830162000124565b604082015191620000628362000112565b6060810151868111620000b357846200007d91830162000124565b936080820151968711620000b357620000a3966200009c920162000193565b93620001fa565b6040516127ee9081620004368239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b03811183821017620000f457604052565b620000b8565b6001600160401b038111620000f45760051b60200190565b6001600160a01b03811603620000b357565b9080601f83011215620000b357815190620001496200014383620000fa565b620000ce565b9182938184526020808095019260051b820101928311620000b3578301905b82821062000177575050505090565b8380918351620001878162000112565b81520191019062000168565b9080601f83011215620000b357815190620001b26200014383620000fa565b9182938184526020808095019260051b820101928311620000b3578301905b828210620001e0575050505090565b81518015158103620000b3578152908301908301620001d1565b600080546001600160a01b03191633908117825591969594939291817f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a3600191828055876003556040519788527f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b851160208099a160028490556040516001600160a01b0394851681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f908990a18051818901989060051b820181013d15158a5b811562000339575b505050604051948186019282875251809352604086019993905b8382106200032157505050505050807f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7916200031f95960390a162000373565b565b845181168b52998201999382019390850190620002df565b908382600182979896949e999e51600c1b55019083821015620003655791509a959a94939294620002bd565b509a959a94939294620002c5565b60008054919290916001600160a01b03163303620004245782519182156200041757815183036200040a57602092919284818080970195019360051b0101925b838103620003c2575050505050565b84809181600c63cbc9d1c48152825186528651918291205581517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a8680a301920191620003b3565b63ff633a3890526004601cfd5b63df95788390526004601cfd5b6040516282b42960e81b8152600490fdfe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806304937320146102065780630d2a2d441461020157806313af4035146101fc5780632cc0f905146101f7578063328a7181146101f2578063367821f0146101ed578063461f3120146101a757806349ef8448146101e85780634b2ae980146101e3578063574983c8146101de5780635fd8c710146101d957806369cc6af4146101d45780636d82d9e0146101cf57806377cd38a4146101ca5780637f94f65d146101c557806380e1d302146101c057806384ab1d28146101bb5780638da5cb5b146101b65780638db564c2146101b15780639872dbfe146101ac57806398a26871146101a75780639eee8d4b146101a2578063ad8f2eed1461019d578063b0983d3914610198578063c52164c614610193578063c593dfd81461018e578063d1c0702814610189578063d4fac45d14610184578063d6e8b9731461017f578063f7d0e04b1461017a5763fb8c5ef00361000e57611678565b611608565b61155d565b611544565b6114a2565b610f64565b610f30565b610ef6565b610ea0565b610e60565b61093c565b610e42565b610e24565b610df0565b610dba565b610da1565b610d50565b610d18565b610c07565b610bc7565b610b44565b610ae0565b610ab6565b610a1f565b610881565b610651565b61058d565b610498565b61036b565b346102325760206003193601126102325760043560005260066020526020604060002054604051908152f35b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176102a757604052565b610237565b60405190610120820182811067ffffffffffffffff8211176102a757604052565b67ffffffffffffffff81116102a75760051b60200190565b73ffffffffffffffffffffffffffffffffffffffff81160361023257565b81601f820112156102325780359161031a836102cd565b926103286040519485610266565b808452602092838086019260051b820101928311610232578301905b828210610352575050505090565b8380918335610360816102e5565b815201910190610344565b34610232576020806003193601126102325760043567ffffffffffffffff81116102325761039d903690600401610303565b9073ffffffffffffffffffffffffffffffffffffffff918260005416330361046e57805181830192849160051b830181013d1515855b811561043a575b50505060405192818401908285525180915260408401949160005b828110610424577f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d786880387a1005b83518516875295810195928101926001016103f5565b90838260018298969499979951600c1b550190838210156104625791509593959492946103d3565b509593959492946103da565b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b34610232576020600319360112610232576004356104b5816102e5565b600090815473ffffffffffffffffffffffffffffffffffffffff808216330361046e577fffffffffffffffffffffffff0000000000000000000000000000000000000000921691829116178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b6064359069ffffffffffffffffffff8216820361023257565b6084359069ffffffffffffffffffff8216820361023257565b9181601f840112156102325782359167ffffffffffffffff8311610232576020808501948460051b010111610232Line truncated
|
||||
|
||||
type P2PIXConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
||||
Vendored
+9
@@ -32,6 +32,10 @@ declare module "hardhat/types/runtime" {
|
||||
name: "ERC20",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ERC20__factory>;
|
||||
getContractFactory(
|
||||
name: "ECDSA",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ECDSA__factory>;
|
||||
getContractFactory(
|
||||
name: "Multicall",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
@@ -78,6 +82,11 @@ declare module "hardhat/types/runtime" {
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ERC20>;
|
||||
getContractAt(
|
||||
name: "ECDSA",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ECDSA>;
|
||||
getContractAt(
|
||||
name: "Multicall",
|
||||
address: string,
|
||||
|
||||
@@ -17,6 +17,8 @@ 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";
|
||||
export { ERC20__factory } from "./factories/lib/tokens/ERC20__factory";
|
||||
export type { ECDSA } from "./lib/utils/ECDSA";
|
||||
export { ECDSA__factory } from "./factories/lib/utils/ECDSA__factory";
|
||||
export type { Multicall } from "./lib/utils/Multicall";
|
||||
export { Multicall__factory } from "./factories/lib/utils/Multicall__factory";
|
||||
export type { ReentrancyGuard } from "./lib/utils/ReentrancyGuard";
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseContract, Signer, utils } from "ethers";
|
||||
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../../common";
|
||||
|
||||
export interface ECDSAInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface ECDSA extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: ECDSAInterface;
|
||||
|
||||
queryFilter<TEvent extends TypedEvent>(
|
||||
event: TypedEventFilter<TEvent>,
|
||||
fromBlockOrBlockhash?: string | number | undefined,
|
||||
toBlock?: string | number | undefined
|
||||
): Promise<Array<TEvent>>;
|
||||
|
||||
listeners<TEvent extends TypedEvent>(
|
||||
eventFilter?: TypedEventFilter<TEvent>
|
||||
): Array<TypedListener<TEvent>>;
|
||||
listeners(eventName?: string): Array<Listener>;
|
||||
removeAllListeners<TEvent extends TypedEvent>(
|
||||
eventFilter: TypedEventFilter<TEvent>
|
||||
): this;
|
||||
removeAllListeners(eventName?: string): this;
|
||||
off: OnEvent<this>;
|
||||
on: OnEvent<this>;
|
||||
once: OnEvent<this>;
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {};
|
||||
|
||||
callStatic: {};
|
||||
|
||||
filters: {};
|
||||
|
||||
estimateGas: {};
|
||||
|
||||
populateTransaction: {};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { ECDSA } from "./ECDSA";
|
||||
export type { Multicall } from "./Multicall";
|
||||
export type { ReentrancyGuard } from "./ReentrancyGuard";
|
||||
export type { SafeTransferLib } from "./SafeTransferLib";
|
||||
@@ -29,7 +29,6 @@ import type {
|
||||
|
||||
export interface P2PIXInterface extends utils.Interface {
|
||||
functions: {
|
||||
"WAD()": FunctionFragment;
|
||||
"_castAddrToKey(address)": FunctionFragment;
|
||||
"_castKeyToAddr(uint256)": FunctionFragment;
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
@@ -40,7 +39,7 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
"getLocksStatus(uint256[])": FunctionFragment;
|
||||
"getPixTarget(address,address)": FunctionFragment;
|
||||
"getValid(address,address)": FunctionFragment;
|
||||
"lock(address,address,address,uint256,uint256,bytes32[],uint256[])": FunctionFragment;
|
||||
"lock(address,address,address,uint80,uint80,bytes32[],uint256[])": FunctionFragment;
|
||||
"lockCounter()": FunctionFragment;
|
||||
"mapLocks(uint256)": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
@@ -65,7 +64,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "WAD"
|
||||
| "_castAddrToKey"
|
||||
| "_castKeyToAddr"
|
||||
| "allowedERC20s"
|
||||
@@ -99,7 +97,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(functionFragment: "WAD", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castAddrToKey",
|
||||
values: [PromiseOrValue<string>]
|
||||
@@ -246,7 +243,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "WAD", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castAddrToKey",
|
||||
data: BytesLike
|
||||
@@ -545,8 +541,6 @@ export interface P2PIX extends BaseContract {
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
WAD(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@@ -632,10 +626,10 @@ export interface P2PIX extends BaseContract {
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
@@ -736,8 +730,6 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@@ -823,10 +815,10 @@ export interface P2PIX extends BaseContract {
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
@@ -927,8 +919,6 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@@ -1014,10 +1004,10 @@ export interface P2PIX extends BaseContract {
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
@@ -1231,8 +1221,6 @@ export interface P2PIX extends BaseContract {
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@@ -1401,8 +1389,6 @@ export interface P2PIX extends BaseContract {
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
WAD(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
|
||||
+10
-10
@@ -850,7 +850,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, price, endtoendID],
|
||||
);
|
||||
const messageHashBytes =
|
||||
@@ -1257,7 +1257,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if lock has expired", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await acc01.signMessage(
|
||||
@@ -1302,7 +1302,7 @@ describe("P2PIX", () => {
|
||||
const target = ethers.BigNumber.from("1");
|
||||
const hashZero = ethers.constants.HashZero;
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, hashZero],
|
||||
);
|
||||
const flatSig = await acc01.signMessage(
|
||||
@@ -1352,7 +1352,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if signed message has already been used", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await owner.signMessage(
|
||||
@@ -1417,7 +1417,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if ecrecovered signer is invalid", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await acc03.signMessage(
|
||||
@@ -1464,7 +1464,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const pixTarget = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 100, endtoendID],
|
||||
);
|
||||
// Note: messageToSign is a string, that is 66-bytes long, to sign the
|
||||
@@ -1632,7 +1632,7 @@ describe("P2PIX", () => {
|
||||
acc03Key,
|
||||
);
|
||||
const messageToSign1 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 100, endtoendID],
|
||||
);
|
||||
const flatSig1 = await owner.signMessage(
|
||||
@@ -1640,7 +1640,7 @@ describe("P2PIX", () => {
|
||||
);
|
||||
const sig1 = ethers.utils.splitSignature(flatSig1);
|
||||
const messageToSign2 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 50, endtoendID],
|
||||
);
|
||||
const flatSig2 = await owner.signMessage(
|
||||
@@ -1648,7 +1648,7 @@ describe("P2PIX", () => {
|
||||
);
|
||||
const sig2 = ethers.utils.splitSignature(flatSig2);
|
||||
const messageToSign3 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 25, endtoendID],
|
||||
);
|
||||
const flatSig3 = await owner.signMessage(
|
||||
@@ -1885,7 +1885,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const pixTarget = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 1, endtoendID],
|
||||
);
|
||||
const messageHashBytes =
|
||||
|
||||
Reference in new issue
Block a user