✨ V2 Release
This commit is contained in:
1 parent
0d612572c6
commit
6fe1e794d0
45 files changed
+3195
-2866
No files matched your search
+5
-2
@@ -1,9 +1,12 @@
|
||||
INFURA_API_KEY="{INSERT_API_KEY}"
|
||||
MNEMONIC="{INSERT_12_WORD_MNEMONIC}"
|
||||
|
||||
INFURA_API_KEY="{INSERT_API_KEY}"
|
||||
ALCHEMY_API_KEY="{INSERT_API_KEY}"
|
||||
|
||||
# Block explorer API keys
|
||||
ETHERSCAN_API_KEY="{INSERT_API_KEY}"
|
||||
POLYGONSCAN_API_KEY="{INSERT_API_KEY}"
|
||||
GASPRICE_API_ENDPOINT="https://api.etherscan.io/api?module=proxy&action=eth_gasPrice"
|
||||
COINMARKETCAP_API_KEY="{INSERT_API_KEY}"
|
||||
|
||||
REPORT_GAS="true"
|
||||
REPORT_GAS="true"
|
||||
@@ -18,7 +18,6 @@
|
||||
│ ├── tokens
|
||||
│ │ └── ERC20.sol
|
||||
│ └── utils
|
||||
│ ├── Counters.sol
|
||||
│ ├── MerkleProofLib.sol
|
||||
│ ├── ReentrancyGuard.sol
|
||||
│ └── SafeTransferLib.sol
|
||||
@@ -30,6 +29,37 @@
|
||||
|
||||

|
||||
|
||||
## Current Deployment addresses
|
||||
|
||||
### V1
|
||||
| Testnet | Token Address | P2pix Address |
|
||||
|--------- |-------------------------------------------- |-------------------------------------------- |
|
||||
| Goerli | 0x294003F602c321627152c6b7DED3EAb5bEa853Ee | 0x5f3EFA9A90532914545CEf527C530658af87e196 |
|
||||
| Mumbai | 0x294003F602c321627152c6b7DED3EAb5bEa853Ee | 0x5f3EFA9A90532914545CEf527C530658af87e196 |
|
||||
|
||||
<!-- All contracts deployed by 0x8dC06F985C131166570825F52447E8c88d64aE20 -->
|
||||
|
||||
<!-- https://goerli.etherscan.io/address/0x294003F602c321627152c6b7DED3EAb5bEa853Ee#code -->
|
||||
|
||||
<!-- https://goerli.etherscan.io/address/0x5f3EFA9A90532914545CEf527C530658af87e196#code -->
|
||||
|
||||
<!-- https://mumbai.polygonscan.com/address/0x294003F602c321627152c6b7DED3EAb5bEa853Ee#code -->
|
||||
|
||||
<!-- https://mumbai.polygonscan.com/address/0x5f3EFA9A90532914545CEf527C530658af87e196#code -->
|
||||
|
||||
### V2
|
||||
| Testnet | Token Address | P2pix Address | Reputation Address |
|
||||
|--------- |-------------------------------------------- |-------------------------------------------- |-------------------------------------------- |
|
||||
| Goerli | 0x4A2886EAEc931e04297ed336Cc55c4eb7C75BA00 | 0x2a54667b566B1Aa3779828720E6696AC18ae3f1b | 0x7c4010CFe2B5446f0c9dcc5e9B596534b2D2eB44 |
|
||||
| Mumbai | 0xC86042E9F2977C62Da8c9dDF7F9c40fde4796A29 | 0x7F4680D114B43c4434FB604c7Bc6306125D32f28 | 0xD38D6367f452D097ccBfDe4490b7de570B6A72Db |
|
||||
|
||||
<!-- All contracts deployed by 0x8dC06F985C131166570825F52447E8c88d64aE20 -->
|
||||
<!-- https://goerli.etherscan.io/address/0x4A2886EAEc931e04297ed336Cc55c4eb7C75BA00#code -->
|
||||
<!-- https://goerli.etherscan.io/address/0x2a54667b566B1Aa3779828720E6696AC18ae3f1b#code -->
|
||||
<!-- https://goerli.etherscan.io/address/0x7c4010CFe2B5446f0c9dcc5e9B596534b2D2eB44#code -->
|
||||
<!-- https://mumbai.polygonscan.com/address/0xC86042E9F2977C62Da8c9dDF7F9c40fde4796A29#code -->
|
||||
<!-- https://mumbai.polygonscan.com/address/0x7F4680D114B43c4434FB604c7Bc6306125D32f28#code -->
|
||||
<!-- https://mumbai.polygonscan.com/address/0xD38D6367f452D097ccBfDe4490b7de570B6A72Db#code -->
|
||||
## Usage
|
||||
|
||||
### Pre Requisites
|
||||
@@ -103,3 +133,20 @@ yarn deploy2:localhost
|
||||
|
||||
**_NOTE_:** The second script transfers 2M tokens to the first wallet of the node.
|
||||
To use the P2Pix smart contract first transfer some of the tokens to other wallets.
|
||||
|
||||
|
||||
## Deploying to testnets
|
||||
|
||||
Deploy to Ethereum's Goerli testnet:
|
||||
|
||||
```sh
|
||||
yarn deploy1:goerli
|
||||
yarn deploy2:goerli
|
||||
```
|
||||
|
||||
Deploy to Polygon's Mumbai testnet:
|
||||
|
||||
```sh
|
||||
yarn deploy1:mumbai
|
||||
yarn deploy2:mumbai
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/f807a312b7619f2547c334c76d81a8da.json"
|
||||
"buildInfo": "../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/f807a312b7619f2547c334c76d81a8da.json"
|
||||
"buildInfo": "../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -202,9 +202,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockID",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
@@ -246,9 +246,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
@@ -271,9 +271,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReturned",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/916d546d680bb337e1c490eb628d93df.json"
|
||||
"buildInfo": "../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -99,8 +99,8 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a35061036b806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100dc57600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102a6565b6100e8565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac3660046102d6565b6101a9565b6000546100c4906001600160a01b031681565b6040516001600160a01b039091168152602001610095565b61008b643a3529440081565b6000546001600160a01b031633146101465760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b60006101cc6101b88380610305565b6101c790643a35294400610324565b6101f4565b6101d983620f4240610305565b6101e3919061033c565b6101ee906001610324565b92915050565b60b58171010000000000000000000000000000000000811061021b5760409190911b9060801c5b690100000000000000000081106102375760209190911b9060401c5b65010000000000811061024f5760109190911b9060201c5b630100000081106102655760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b6000602082840312156102b857600080fd5b81356001600160a01b03811681146102cf57600080fd5b9392505050565b6000602082840312156102e857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561031f5761031f6102ef565b500290565b60008219821115610337576103376102ef565b500190565b60008261035957634e487b7160e01b600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100dc57600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102a6565b6100e8565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac3660046102d6565b6101a9565b6000546100c4906001600160a01b031681565b6040516001600160a01b039091168152602001610095565b61008b643a3529440081565b6000546001600160a01b031633146101465760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b60006101cc6101b88380610305565b6101c790643a35294400610324565b6101f4565b6101d983620f4240610305565b6101e3919061033c565b6101ee906001610324565b92915050565b60b58171010000000000000000000000000000000000811061021b5760409190911b9060801c5b690100000000000000000081106102375760209190911b9060401c5b65010000000000811061024f5760109190911b9060201c5b630100000081106102655760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b6000602082840312156102b857600080fd5b81356001600160a01b03811681146102cf57600080fd5b9392505050565b6000602082840312156102e857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561031f5761031f6102ef565b500290565b60008219821115610337576103376102ef565b500190565b60008261035957634e487b7160e01b600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350610416806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -330,8 +330,8 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60e06040523480156200001157600080fd5b506040516200105238038062001052833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610c87620003cb60003960006104630152600061042e015260006101540152610c876000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152Line truncated
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610677573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106ad5750876001600160a01b0316816001600160a01b0316145b6106f95760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610556565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b815160005b818110156107a25761079284828151811061078457610784610b95565b602002602001015184610842565b61079b81610bab565b9050610767565b50505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516107da9190610bc6565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546108549190610c62565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b818110156108da578581018301518582016040015282016108be565b818111156108ec576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461091957600080fd5b919050565b6000806040838503121561093157600080fd5b61093a83610902565b946020939093013593505050565b60008060006060848603121561095d57600080fd5b61096684610902565b925061097460208501610902565b9150604084013590509250925092565b60006020828403121561099657600080fd5b61099f82610902565b9392505050565b600080600080600080600060e0888a03Line truncated
|
||||
"bytecode": "0x60e06040523480156200001157600080fd5b506040516200129938038062001299833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610ece620003cb60003960006104c20152600061048d015260006101540152610ece6000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906109f2565b60405180910390f35b610115610110366004610a8e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610ab8565b610345565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e610489565b61012e61019e366004610af4565b60036020526000908152604090205481565b61012e6101be366004610af4565b60056020526000908152604090205481565b6100ec6104e4565b6101156101e6366004610a8e565b6104f1565b6101fe6101f9366004610b16565b610576565b005b61012e61020e366004610b89565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610beb565b61089a565b6000805461024b90610cd4565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610cd4565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103349086815260200190565b60405180910390a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526004602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146103d9576103a78382610d57565b73ffffffffffffffffffffffffffffffffffffffff861660009081526004602090815260408083203384529091529020555b73ffffffffffffffffffffffffffffffffffffffff85166000908152600360205260408120805485929061040e908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104769087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104bf576104ba6108e0565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610cd4565b33600090815260036020526040812080548391908390610512908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103349086815260200190565b428410156105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b600060016105f1610489Line truncated
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906109f2565b60405180910390f35b610115610110366004610a8e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610ab8565b610345565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e610489565b61012e61019e366004610af4565b60036020526000908152604090205481565b61012e6101be366004610af4565b60056020526000908152604090205481565b6100ec6104e4565b6101156101e6366004610a8e565b6104f1565b6101fe6101f9366004610b16565b610576565b005b61012e61020e366004610b89565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610beb565b61089a565b6000805461024b90610cd4565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610cd4565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103349086815260200190565b60405180910390a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526004602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146103d9576103a78382610d57565b73ffffffffffffffffffffffffffffffffffffffff861660009081526004602090815260408083203384529091529020555b73ffffffffffffffffffffffffffffffffffffffff85166000908152600360205260408120805485929061040e908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104769087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104bf576104ba6108e0565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610cd4565b33600090815260036020526040812080548391908390610512908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103349086815260200190565b428410156105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b600060016105f1610489565b73ffffffffffffffffffffffffffffffffffffffff8a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e0830190915280519201919091207f190100000000000000000000000000000000000000000000000000000000000061010083015261010282019290925261012281019190915261014201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610743573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116158015906107be57508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f494e56414c49445f5349474e455200000000000000000000000000000000000060448201526064016105dc565b73ffffffffffffffffffffffffffffffffffffffff90811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b815160005b818110156108da576108ca8482815181106108bc576108bc610d6e565b60200260200101518461097a565b6108d381610d9d565b905061089f565b50505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516109129190610dd6565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806002600082825461098c9190610ea9565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152600360209081526040Line truncated
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Counters",
|
||||
"sourceName": "contracts/lib/utils/Counters.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0043b38db58c3ff291cf622f3b61e1a3.json"
|
||||
"buildInfo": "../../../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/a89635dd94b1e537327e1582c6d97eb3.json"
|
||||
"buildInfo": "../../build-info/6801f23dfb2a9667d9e89d4173ae1ee7.json"
|
||||
}
|
||||
@@ -238,9 +238,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockID",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
@@ -282,9 +282,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
@@ -307,9 +307,9 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReturned",
|
||||
@@ -544,6 +544,30 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "sellers",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getBalances",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "balances",
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@@ -630,17 +654,17 @@
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"internalType": "uint256[]",
|
||||
"name": "expiredLocks",
|
||||
"type": "bytes32[]"
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
"name": "lock",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "lockID",
|
||||
"type": "bytes32"
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
@@ -662,9 +686,9 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mapLocks",
|
||||
@@ -739,9 +763,9 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"internalType": "uint256",
|
||||
"name": "lockID",
|
||||
"type": "bytes32"
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
@@ -939,9 +963,9 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"internalType": "uint256[]",
|
||||
"name": "lockIDs",
|
||||
"type": "bytes32[]"
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
"name": "unlockExpired",
|
||||
@@ -1014,19 +1038,18 @@
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256[]",
|
||||
"name": "expiredLocks",
|
||||
"type": "bytes32[]"
|
||||
"type": "uint256[]"
|
||||
}
|
||||
],
|
||||
"name": "withdraw",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_sellerBalance",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
@@ -1042,8 +1065,8 @@
|
||||
"type": "receive"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60806040526001805560405162002aa438038062002aa48339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806003557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600860205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083018260051b82015b8083146200037f578251600052600a60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b61247480620006306000396000f3fe6080604052600436106101d15760003560e01c80637f94f65d116100f75780639872dbfe11610095578063c52164c611610064578063c52164c6146106cc578063d4fac45d146106ec578063d6e8b9731461074b578063f7d0e04b1461076b57600080fd5b80639872dbfe146105fa57806398a26871146106105780639eee8d4b14610640578063ad8f2eed1461067857600080fd5b806385313e73116100d157806385313e73146105845780638da5cb5b146105a45780638db564c2146105c45780638e2749d6146105da57600080fd5b80637f94f65d146104d757806380e1d302146104f757806384ab1d281461054b57600080fd5b80634b2ae9801161016f5780636a1460241161013e5780636a1460241461044e5780636d82d9e01461046a578063758d77d41461048a57806377cd38a4146104aa57600080fd5b80634b2ae980146103be578063574983c8146103e95780635fd8c7101461040957806369cc6af41461041e57600080fd5b806316d72240116101ab57806316d722401461025f5780632b9f00e91461033e578063328a71811461035e578063461f31201461037e57600080fd5b806304937320146101dd5780630d2a2d441461021d57806313af40351461023f57600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5061020a6101f8366004611ddb565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561022957600080fd5b5061023d610238366004611ee8565b61078b565b005b34801561024b57600080fd5b5061023d61025a366004611f25565b61087c565b34801561026b57600080fd5b506102df61027a366004611ddb565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006860154600787015460088801546009909801549698959794969395946001600160a01b0393841694928416939182169290821691168a565b604080519a8b5260208b019990995297890196909652606088019490945260808701929092526001600160a01b0390811660a087015290811660c086015290811660e08501529081166101008401521661012082015261014001610214565b34801561034a57600080fd5b5061020a610359366004611f8e565b61091d565b34801561036a57600080fd5b5061023d610379366004612074565b610c90565b34801561038a57600080fd5bLine truncated
|
||||
"deployedBytecode": "0x6080604052600436106101d15760003560e01c80637f94f65d116100f75780639872dbfe11610095578063c52164c611610064578063c52164c6146106cc578063d4fac45d146106ec578063d6e8b9731461074b578063f7d0e04b1461076b57600080fd5b80639872dbfe146105fa57806398a26871146106105780639eee8d4b14610640578063ad8f2eed1461067857600080fd5b806385313e73116100d157806385313e73146105845780638da5cb5b146105a45780638db564c2146105c45780638e2749d6146105da57600080fd5b80637f94f65d146104d757806380e1d302146104f757806384ab1d281461054b57600080fd5b80634b2ae9801161016f5780636a1460241161013e5780636a1460241461044e5780636d82d9e01461046a578063758d77d41461048a57806377cd38a4146104aa57600080fd5b80634b2ae980146103be578063574983c8146103e95780635fd8c7101461040957806369cc6af41461041e57600080fd5b806316d72240116101ab57806316d722401461025f5780632b9f00e91461033e578063328a71811461035e578063461f31201461037e57600080fd5b806304937320146101dd5780630d2a2d441461021d57806313af40351461023f57600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5061020a6101f8366004611ddb565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561022957600080fd5b5061023d610238366004611ee8565b61078b565b005b34801561024b57600080fd5b5061023d61025a366004611f25565b61087c565b34801561026b57600080fd5b506102df61027a366004611ddb565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006860154600787015460088801546009909801549698959794969395946001600160a01b0393841694928416939182169290821691168a565b604080519a8b5260208b019990995297890196909652606088019490945260808701929092526001600160a01b0390811660a087015290811660c086015290811660e08501529081166101008401521661012082015261014001610214565b34801561034a57600080fd5b5061020a610359366004611f8e565b61091d565b34801561036a57600080fd5b5061023d610379366004612074565b610c90565b34801561038a57600080fd5b506103ae610399366004611ddb565b60096020526000908152604090205460ff1681565b6040519015158152602001610214565b3480156103ca57600080fd5b5061020a6103d9366004611f25565b600c1b611000600160ac1b031690565b3480156103f557600080fd5b5061023d610404366004611ddb565b610e4f565b34801561041557600080fd5b5061023d610ecd565b34801561042a57600080fd5b506103ae610439366004611f25565b600a6020526000908152604090205460ff1681565b34801561045a57600080fd5b5061020a670de0b6b3a764000081565b34801561047657600080fd5b5061023d6104853660046120e7565b610f57565b34801561049657600080fd5b5061023d6104a536600461211c565b611045565b3480156104b657600080fd5b5061020a6104c5366004611ddb565b60066020526000908152604090205481565b3480156104e357600080fd5b5061023d6104f2366004612180565b611429565b34801561050357600080fd5b506103ae6105123660046121ac565b600c9190911b611000600160ac1b03166000908152600b602090815260408083206001600160a01b039094168352929052205460ff1c90565b34801561055757600080fd5b5061056c610566366004611ddb565b600c1c90565b6040516001600160a01b039091168152602001610214565b34801561059057600080fd5b5061020a61059f3660046121e5565b6114bc565b3480156105b057600080fd5b5060005461056c906001600160a01b031681565b3480156105d057600080fd5b5061020a60045481565b3480156105e657600080fd5b5061023d6105f536600461223a565b6115ee565b34801561060657600080fd5b5061020a60035481565b34801561061c57600080fd5b506103ae61062b366004611ddb565b60086020526000908152604090205460ff1681565b34801561064c57600080fd5b5061020a61065b36600461227c565b600b60209081526000928352604080842090915290825290205481565b34801561068457600080fd5b5061056c6106933660046121ac565b600c9190911b611000600160ac1b03166000908152600b602090815260408083206001600160a01b0390941683529290522054605f1c90565b3480156106d857600080fd5b5060025461056c906001600160a01b031681565b3480156106f857600080fd5b5061020a6107073660046121ac565b600c9190911b611000600160ac1b03166000908152600b602090815260408083206001600160a01b03909416835292905220546b3fffffffffffffffffffffff1690565b34801561075757600080fd5b5061023d6107663660046122a1565b6117de565b34801561077757600080fd5b5061023d610786366004611f25565b6118b6565b6000546001600160a01b031633146107d95760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b80516000905b808210156108405760006108198484815181106107fe576107fe612363565b6020026020010151611000600160ac1b03600c9190911b1690565b6000908152600860205260409020805460ff191660019081179091559290920191506107df565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7816040516108719190612379565b60405180910390a150565b6000546001600160a01b031633146108c55760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016107d0565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061092761193d565b61093183836115ee565b600c8b901b611000600160ac1b03166000908152600b602090815260408083206001600160a01b038e1684529091529020548a9060ff1c61098557604051635972996f60e11b815260040160405180910390fd5b611000600160ac1b03600c8d901b166000908152600b602090815260408083206001600160a01b03851684529091529020Line truncated
|
||||
"bytecode": "0x6080604052600180556040516200322a3803806200322a8339810160408190526200002a9162000493565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000616565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806003557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005b1565b60200260200101516200038760201b60201c565b6000908152600860205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005c7565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083018260051b82015b8083146200037f578251600052600a60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b90565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003ce57620003ce6200038d565b604052919050565b60006001600160401b03821115620003f257620003f26200038d565b5060051b60200190565b6001600160a01b03811681146200041257600080fd5b50565b600082601f8301126200042757600080fd5b81516020620004406200043a83620003d6565b620003a3565b82815260059290921b840181019181810190868411156200046057600080fd5b8286015b84811015620004885780516200047a81620003fc565b835291830191830162000464565b509695505050505050565b600080600080600060a08688031215620004ac57600080fd5b8551602080880151919650906001600160401b0380821115620004ce57600080fd5b620004dc8a838b0162000415565b965060408901519150620004f082620003fc565b6060890151919550808211156200050657600080fd5b620005148a838b0162000415565b945060808901519150808211156200052b57600080fd5b508701601f810189136200053e57600080fd5b80516200054f6200043a82620003d6565b81815260059190911b8201830190838101908b8311156200056f57600080fd5b928401925b828410156200059f57835180151581146200058f5760008081fd5b8252928401929084019062000574565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b818110156200060a5783516001600160a01b031683529284019291840191600101620005e3565b50909695505050505050565b612c0480620006266000396000f3fe6080604052600436106101dc5760003560e01c80637f94f65d11610102578063ad8f2eed11610095578063d4fac45d11610064578063d4fac45d14610713578063d6e8b9731461075e578063f7d0e04b1461077e578063fb8c5ef01461079e57600080fd5b8063ad8f2eed14610659578063b0983d3914610699578063c52164c6146106b9578063d1c07028146106e657600080fd5b80638db564c2116100d15780638db564c2146105c55780639872dbfe146105db57806398a26871146105f15780639eee8d4b1461062157600080fd5b80637f94f65d146104f257806380e1d3021461051257806384ab1d28146105525780638da5cb5b1461059857600080fd5b80634b2ae9801161017a5780636a146024116101495780636a146024146104695780636d82d9e01461048557806374ba03a0146104a557806377cd38a4146104c557600080fd5b80634b2ae980146103e3578063574983c8146104045780635fd8c7101461042457806369cc6af41461043957600080fd5b806313af4035116101b657806313af40351461026a578063328a71811461028a578063367821f0146102aa578063461f3120146103a357600080fd5b806304937320146101e85780630a98b9bd146102285780630d2a2d441461024857600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610215610203366004612406565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561023457600080fd5b5061021561024336600461248d565b6107be565b34801561025457600080fd5b50610268610263366004612674565b610b6d565b005b34801561027657600080fd5b506102686102853660046126b1565b610ca7565b34801561029657600080fd5b506102686102a53660046126ea565b610d98565b3480156102b657600080fd5b506103376102c5366004612406565b6005602081905260009182526040909120805460018201546002830154600384015460048501549585015460068601546007870154600888015460099098015496989597949693959473ffffffffffffffffffffffffffffffffffffffff93841694928416939182169290821691168a565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925273ffffffffffffffffffffffffffffffffffffffff90811660a087015290811660c086015290811660e085015290811661010084015216Line truncated
|
||||
"deployedBytecode": "0x6080604052600436106101dc5760003560e01c80637f94f65d11610102578063ad8f2eed11610095578063d4fac45d11610064578063d4fac45d14610713578063d6e8b9731461075e578063f7d0e04b1461077e578063fb8c5ef01461079e57600080fd5b8063ad8f2eed14610659578063b0983d3914610699578063c52164c6146106b9578063d1c07028146106e657600080fd5b80638db564c2116100d15780638db564c2146105c55780639872dbfe146105db57806398a26871146105f15780639eee8d4b1461062157600080fd5b80637f94f65d146104f257806380e1d3021461051257806384ab1d28146105525780638da5cb5b1461059857600080fd5b80634b2ae9801161017a5780636a146024116101495780636a146024146104695780636d82d9e01461048557806374ba03a0146104a557806377cd38a4146104c557600080fd5b80634b2ae980146103e3578063574983c8146104045780635fd8c7101461042457806369cc6af41461043957600080fd5b806313af4035116101b657806313af40351461026a578063328a71811461028a578063367821f0146102aa578063461f3120146103a357600080fd5b806304937320146101e85780630a98b9bd146102285780630d2a2d441461024857600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610215610203366004612406565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561023457600080fd5b5061021561024336600461248d565b6107be565b34801561025457600080fd5b50610268610263366004612674565b610b6d565b005b34801561027657600080fd5b506102686102853660046126b1565b610ca7565b34801561029657600080fd5b506102686102a53660046126ea565b610d98565b3480156102b657600080fd5b506103376102c5366004612406565b6005602081905260009182526040909120805460018201546002830154600384015460048501549585015460068601546007870154600888015460099098015496989597949693959473ffffffffffffffffffffffffffffffffffffffff93841694928416939182169290821691168a565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925273ffffffffffffffffffffffffffffffffffffffff90811660a087015290811660c086015290811660e0850152908116610100840152166101208201526101400161021f565b3480156103af57600080fd5b506103d36103be366004612406565b60096020526000908152604090205460ff1681565b604051901515815260200161021f565b3480156103ef57600080fd5b506102156103fe3660046126b1565b600c1b90565b34801561041057600080fd5b5061026861041f366004612406565b610fd9565b34801561043057600080fd5b5061026861108f565b34801561044557600080fd5b506103d36104543660046126b1565b600a6020526000908152604090205460ff1681565b34801561047557600080fd5b50610215670de0b6b3a764000081565b34801561049157600080fd5b506102686104a036600461275d565b611151565b3480156104b157600080fd5b506102686104c0366004612792565b611268565b3480156104d157600080fd5b506102156104e0366004612406565b60066020526000908152604090205481565b3480156104fe57600080fd5b5061026861050d3660046127f6565b611747565b34801561051e57600080fd5b506103d361052d366004612822565b600c9190911b6000908152600b60209081526040808320938352929052205460ff1c90565b34801561055e57600080fd5b5061057361056d366004612406565b600c1c90565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021f565b3480156105a457600080fd5b506000546105739073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105d157600080fd5b5061021560045481565b3480156105e757600080fd5b5061021560035481565b3480156105fd57600080fd5b506103d361060c366004612406565b60086020526000908152604090205460ff1681565b34801561062d57600080fd5b5061021561063c36600461285b565b600b60209081526000928352604080842090915290825290205481565b34801561066557600080fd5b50610573610674366004612822565b600c9190911b6000908152600b602090815260408083209383529290522054605f1c90565b3480156106a557600080fd5b506102686106b4366004612880565b61180d565b3480156106c557600080fd5b506002546105739073ffffffffffffffffffffffffffffffffffffffff1681565b3480156106f257600080fd5b506107066107013660046128c2565b611a50565b60405161021f9190612909565b34801561071f57600080fd5b5061021561072e366004612822565b600c9190911b6000908152600b6020908152604080832093835292905220546b3fffffffffffffffffffffff1690565b34801561076a57600080fd5b5061026861077936600461294d565b611b5b565b34801561078a57600080fd5b506102686107993660046126b1565b611c6b565b3480156107aa57600080fd5b506102686107b9366004612a0f565b611d37565b60006107c8611e33565b6107d2838361180d565b600c8b901b6000908152600b602090815260408083208d84529091529020548a9060ff1c61082c576040517fb2e532de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600c8c901b6000908152600b602090815260408083208484529091529020546b3fffffffffffffffffffffff1687811015610893576040517f22bbb43c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061089f8e600c1b90565b9050600060045460016108b29190612a9a565b60008181526005602052604090206004015490915043116108ff576040517fd0404f8500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518061014001604052808481526020018381526020018d81526020018c8152602001600354436109339190612a9a565b8152602001605f600b600087815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054901c73ffffffffffffffffffffffffffffffffffffffff1681526020018f73ffffffffffffffffffffffffLine truncated
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -23,18 +23,18 @@ interface EventAndErrors {
|
||||
);
|
||||
event LockAdded(
|
||||
address indexed buyer,
|
||||
bytes32 indexed lockID,
|
||||
uint256 indexed lockID,
|
||||
uint256 seller,
|
||||
uint256 amount
|
||||
);
|
||||
event LockReleased(
|
||||
address indexed buyer,
|
||||
bytes32 lockId,
|
||||
uint256 lockId,
|
||||
uint256 amount
|
||||
);
|
||||
event LockReturned(
|
||||
address indexed buyer,
|
||||
bytes32 lockId
|
||||
uint256 lockId
|
||||
);
|
||||
event FundsWithdrawn(
|
||||
address owner,
|
||||
@@ -108,8 +108,10 @@ interface EventAndErrors {
|
||||
|
||||
/// @dev 0xce3a3d37
|
||||
error DecOverflow();
|
||||
/// @dev 0x
|
||||
/// @dev 0xf3fb0eb9
|
||||
error MaxBalExceeded();
|
||||
/// @dev 0x6a3bc53e
|
||||
error EmptyPixTarget();
|
||||
/// @dev 0x87138d5c
|
||||
error NotInitialized();
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity >=0.8.4;
|
||||
|
||||
/// @title Counters
|
||||
/// @author buf0t9
|
||||
/// @author Modified from OpenZeppelin Contracts
|
||||
/// (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol)
|
||||
/// @notice Provides counters that can only be incremented, decrementedor reset.
|
||||
/// @dev Include with `using Counters for Counters.Counter;`
|
||||
library Counters {
|
||||
// solhint-disable no-inline-assembly
|
||||
struct Counter {
|
||||
/// @dev Interactions must be restricted to the library's function.
|
||||
uint256 _val; // := 0
|
||||
}
|
||||
|
||||
/// @dev 0xce3a3d37
|
||||
error DecOverflow();
|
||||
|
||||
function current(
|
||||
Counter storage counter
|
||||
) internal view returns (uint256 _val) {
|
||||
assembly {
|
||||
_val := sload(counter.slot)
|
||||
}
|
||||
}
|
||||
|
||||
function increment(Counter storage counter) internal {
|
||||
assembly {
|
||||
let _val := sload(counter.slot)
|
||||
sstore(counter.slot, add(_val, 0x01))
|
||||
}
|
||||
}
|
||||
|
||||
function decrement(Counter storage counter) internal {
|
||||
assembly {
|
||||
let _val := sload(counter.slot)
|
||||
if or(iszero(_val), lt(_val, 0x00)) {
|
||||
mstore(0x00, 0xce3a3d37)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
sstore(counter.slot, sub(_val, 0x01))
|
||||
}
|
||||
}
|
||||
|
||||
function reset(Counter storage counter) internal {
|
||||
assembly {
|
||||
sstore(counter.slot, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
+327
-277
@@ -9,7 +9,6 @@ pragma solidity 0.8.9;
|
||||
///
|
||||
|
||||
import { Owned } from "./lib/auth/Owned.sol";
|
||||
// import { Counters } from "./lib/utils/Counters.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";
|
||||
@@ -24,22 +23,22 @@ contract P2PIX is
|
||||
{
|
||||
// solhint-disable use-forbidden-name
|
||||
// solhint-disable no-inline-assembly
|
||||
// solhint-disable no-empty-blocks
|
||||
|
||||
// using Counters for Counters.Counter;
|
||||
using DT for DT.Lock;
|
||||
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 constant private BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 private constant BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
/// @dev The bit position of `pixTarget` in `sellerBalance`.
|
||||
uint256 constant private BITPOS_PIXTARGET = 95;
|
||||
uint256 private constant BITPOS_PIXTARGET = 95;
|
||||
/// @dev The bit position of `valid` in `sellerBalance`.
|
||||
uint256 constant private BITPOS_VALID = 255;
|
||||
uint256 private constant BITPOS_VALID = 255;
|
||||
/// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one.
|
||||
uint256 constant private BITMASK_VALID = (1 << 255) - 1;
|
||||
uint256 private constant BITMASK_VALID = (1 << 255) - 1;
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 constant public WAD = 1e18;
|
||||
uint256 public constant WAD = 1e18;
|
||||
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
@@ -51,7 +50,7 @@ contract P2PIX is
|
||||
uint256 public lockCounter;
|
||||
|
||||
/// @dev List of Locks.
|
||||
mapping(bytes32 => DT.Lock) public mapLocks;
|
||||
mapping(uint256 => DT.Lock) public mapLocks;
|
||||
/// @dev Seller casted to key => Seller's allowlist merkleroot.
|
||||
mapping(uint256 => bytes32) public sellerAllowList;
|
||||
/// @dev Stores an relayer's last computed credit.
|
||||
@@ -66,11 +65,12 @@ contract P2PIX is
|
||||
// BITS LAYOUT
|
||||
// `uint96` [0...94] := balance
|
||||
// `uint160` [95...254] := pixTarget
|
||||
// `bool` [255] := valid
|
||||
|
||||
// `bool` [255] := valid
|
||||
|
||||
/// @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))
|
||||
public sellerBalance;
|
||||
|
||||
/// ███ Constructor ████████████████████████████████████████████████████████
|
||||
|
||||
@@ -105,17 +105,17 @@ contract P2PIX is
|
||||
) public {
|
||||
ERC20 t = ERC20(_token);
|
||||
uint256 k = _castAddrToKey(msg.sender);
|
||||
|
||||
if(_pixTarget == 0)
|
||||
|
||||
if (_pixTarget == 0)
|
||||
revert EmptyPixTarget();
|
||||
if (!allowedERC20s[t])
|
||||
revert TokenDenied();
|
||||
uint256 _sellerBalance =
|
||||
sellerBalance[k][t];
|
||||
|
||||
|
||||
uint256 currBal =
|
||||
_sellerBalance & BITMASK_SB_ENTRY;
|
||||
if ((currBal + _amount) > 1e8 ether)
|
||||
_sellerBalance & BITMASK_SB_ENTRY;
|
||||
if ((currBal + _amount) > 1e8 ether)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
setReentrancyGuard();
|
||||
@@ -123,17 +123,25 @@ contract P2PIX is
|
||||
if (allowlistRoot != 0) {
|
||||
setRoot(msg.sender, allowlistRoot);
|
||||
}
|
||||
|
||||
|
||||
uint256 amountCasted;
|
||||
uint256 pixTargetCasted;
|
||||
uint256 validCasted;
|
||||
(amountCasted, pixTargetCasted, validCasted) =
|
||||
_castToUint(_amount, _pixTarget, _valid);
|
||||
sellerBalance[k][t] =
|
||||
(currBal + amountCasted) |
|
||||
(pixTargetCasted << BITPOS_PIXTARGET) |
|
||||
(validCasted << BITPOS_VALID);
|
||||
(
|
||||
amountCasted,
|
||||
pixTargetCasted,
|
||||
validCasted
|
||||
) = _castToUint(
|
||||
_amount,
|
||||
_pixTarget,
|
||||
_valid
|
||||
);
|
||||
|
||||
sellerBalance[k][t] =
|
||||
(currBal + amountCasted) |
|
||||
(pixTargetCasted << BITPOS_PIXTARGET) |
|
||||
(validCasted << BITPOS_VALID);
|
||||
|
||||
SafeTransferLib.safeTransferFrom(
|
||||
t,
|
||||
msg.sender,
|
||||
@@ -144,8 +152,8 @@ contract P2PIX is
|
||||
clearReentrancyGuard();
|
||||
|
||||
emit DepositAdded(
|
||||
msg.sender,
|
||||
_token,
|
||||
msg.sender,
|
||||
_token,
|
||||
_amount
|
||||
);
|
||||
}
|
||||
@@ -155,23 +163,27 @@ contract P2PIX is
|
||||
/// @dev This function does not affect any ongoing active locks.
|
||||
/// @dev Function sighash: 0x72fada5c.
|
||||
function setValidState(ERC20 token, bool state) public {
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
uint256 key =
|
||||
_castAddrToKey(msg.sender);
|
||||
uint256 _sellerBalance =
|
||||
sellerBalance[key][token];
|
||||
|
||||
if (_sellerBalance != 0) {
|
||||
uint256 _valid;
|
||||
assembly {
|
||||
_valid := state
|
||||
}
|
||||
_sellerBalance = (_sellerBalance & BITMASK_VALID) |
|
||||
(_valid << BITPOS_VALID);
|
||||
sellerBalance[key][token] = _sellerBalance;
|
||||
assembly { _valid := state }
|
||||
|
||||
emit ValidSet(
|
||||
msg.sender,
|
||||
address(token),
|
||||
state
|
||||
);
|
||||
_sellerBalance =
|
||||
(_sellerBalance & BITMASK_VALID) |
|
||||
(_valid << BITPOS_VALID);
|
||||
|
||||
sellerBalance[key][token] =
|
||||
_sellerBalance;
|
||||
|
||||
emit ValidSet(
|
||||
msg.sender,
|
||||
address(token),
|
||||
state
|
||||
);
|
||||
} else
|
||||
revert NotInitialized();
|
||||
}
|
||||
@@ -203,39 +215,38 @@ contract P2PIX is
|
||||
uint256 _relayerPremium,
|
||||
uint256 _amount,
|
||||
bytes32[] calldata merkleProof,
|
||||
bytes32[] calldata expiredLocks
|
||||
) public nonReentrant returns (bytes32 lockID) {
|
||||
uint256[] calldata expiredLocks
|
||||
) public nonReentrant returns (uint256) {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
ERC20 t = ERC20(_token);
|
||||
if (!getValid(_seller, t))
|
||||
revert InvalidDeposit();
|
||||
uint256 bal = getBalance(_seller, t);
|
||||
|
||||
uint256 bal =
|
||||
getBalance(_seller, t);
|
||||
if (bal < _amount)
|
||||
revert NotEnoughTokens();
|
||||
|
||||
uint256 k =
|
||||
_castAddrToKey(_seller);
|
||||
|
||||
uint256 cachedCounter =
|
||||
lockCounter + 1;
|
||||
uint256 cCounter =
|
||||
lockCounter + 1;
|
||||
|
||||
lockID = keccak256(
|
||||
abi.encodePacked(
|
||||
lockCounter,
|
||||
_amount,
|
||||
_buyerAddress
|
||||
)
|
||||
);
|
||||
if (mapLocks[lockID].expirationBlock >= block.number)
|
||||
revert NotExpired();
|
||||
if (mapLocks[cCounter].expirationBlock
|
||||
>= block.number)
|
||||
revert NotExpired();
|
||||
|
||||
DT.Lock memory l = DT.Lock(
|
||||
k,
|
||||
cachedCounter,
|
||||
cCounter,
|
||||
_relayerPremium,
|
||||
_amount,
|
||||
(block.number + defaultLockBlocks),
|
||||
uint160(sellerBalance[k][t] >> BITPOS_PIXTARGET),
|
||||
(block.number +
|
||||
defaultLockBlocks),
|
||||
uint160(sellerBalance[k][t]
|
||||
>> BITPOS_PIXTARGET),
|
||||
_buyerAddress,
|
||||
_relayerTarget,
|
||||
msg.sender,
|
||||
@@ -250,56 +261,62 @@ contract P2PIX is
|
||||
);
|
||||
|
||||
_addLock(
|
||||
bal,
|
||||
_amount,
|
||||
lockID,
|
||||
bal,
|
||||
_amount,
|
||||
cCounter,
|
||||
l,
|
||||
t,
|
||||
k);
|
||||
|
||||
k
|
||||
);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return lockID;
|
||||
return cCounter;
|
||||
|
||||
} else {
|
||||
if (l.amount <= 1e2 ether) {
|
||||
_addLock(
|
||||
bal,
|
||||
_amount,
|
||||
lockID,
|
||||
l,
|
||||
t,
|
||||
k);
|
||||
|
||||
lockCounter++;
|
||||
bal,
|
||||
_amount,
|
||||
cCounter,
|
||||
l,
|
||||
t,
|
||||
k
|
||||
);
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return lockID;
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
|
||||
} else {
|
||||
uint256 userCredit = userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
];
|
||||
|
||||
uint256 spendLimit;
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
(spendLimit) =
|
||||
_limiter(userCredit / WAD);
|
||||
|
||||
if (l.amount > (spendLimit * WAD) ||
|
||||
l.amount > 1e6 ether)
|
||||
revert AmountNotAllowed();
|
||||
if (
|
||||
l.amount > (spendLimit * WAD) ||
|
||||
l.amount > 1e6 ether
|
||||
) revert AmountNotAllowed();
|
||||
|
||||
_addLock(
|
||||
bal,
|
||||
_amount,
|
||||
lockID,
|
||||
l,
|
||||
t,
|
||||
k);
|
||||
|
||||
lockCounter++;
|
||||
_addLock(
|
||||
bal,
|
||||
_amount,
|
||||
cCounter,
|
||||
l,
|
||||
t,
|
||||
k
|
||||
);
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return lockID;
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,7 +335,7 @@ contract P2PIX is
|
||||
/// @param _relayerTarget Target address entitled to the `relayerPremim`.
|
||||
/// @dev Function sighash: 0x4e1389ed.
|
||||
function release(
|
||||
bytes32 lockID,
|
||||
uint256 lockID,
|
||||
address _relayerTarget,
|
||||
bytes32 pixTimestamp,
|
||||
bytes32 r,
|
||||
@@ -358,22 +375,25 @@ contract P2PIX is
|
||||
ERC20 t = ERC20(l.token);
|
||||
|
||||
// We cache values before zeroing them out.
|
||||
uint256 lockAmount = l.amount;
|
||||
uint256 totalAmount = (lockAmount - l.relayerPremium);
|
||||
uint256 lockAmount =
|
||||
l.amount;
|
||||
uint256 totalAmount =
|
||||
(lockAmount - l.relayerPremium);
|
||||
|
||||
l.amount = 0;
|
||||
l.expirationBlock = 0;
|
||||
usedTransactions[message] = true;
|
||||
|
||||
if (msg.sender != l.relayerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += l
|
||||
.relayerPremium;
|
||||
userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
] += l.relayerPremium;
|
||||
userRecord[
|
||||
_castAddrToKey(l.relayerAddress)
|
||||
] += lockAmount;
|
||||
} else {
|
||||
userRecord[_castAddrToKey(msg.sender)] += (l
|
||||
.relayerPremium + lockAmount);
|
||||
userRecord[_castAddrToKey(msg.sender)]
|
||||
+= (l.relayerPremium + lockAmount);
|
||||
}
|
||||
|
||||
SafeTransferLib.safeTransfer(
|
||||
@@ -404,7 +424,11 @@ contract P2PIX is
|
||||
}
|
||||
}
|
||||
|
||||
emit LockReleased(l.buyerAddress, lockID, lockAmount);
|
||||
emit LockReleased(
|
||||
l.buyerAddress,
|
||||
lockID,
|
||||
lockAmount
|
||||
);
|
||||
}
|
||||
|
||||
/// @notice Unlocks expired locks.
|
||||
@@ -413,38 +437,49 @@ contract P2PIX is
|
||||
/// @dev For each successfull unexpired lock recovered,
|
||||
/// `userRecord[_castAddrToKey(l.relayerAddress)]` is decreased by half of its value.
|
||||
/// @dev Function sighash: 0x8e2749d6.
|
||||
function unlockExpired(
|
||||
bytes32[] calldata lockIDs
|
||||
) public {
|
||||
function unlockExpired(uint256[] calldata lockIDs)
|
||||
public
|
||||
{
|
||||
uint256 i;
|
||||
uint256 locksSize = lockIDs.length;
|
||||
|
||||
for (i; i < locksSize; ) {
|
||||
DT.Lock storage l = mapLocks[lockIDs[i]];
|
||||
DT.Lock storage l =
|
||||
mapLocks[lockIDs[i]];
|
||||
|
||||
_notExpired(l);
|
||||
|
||||
uint256 _sellerBalance =
|
||||
sellerBalance[l.sellerKey][ERC20(l.token)] & BITMASK_SB_ENTRY;
|
||||
if((_sellerBalance + l.amount) > 1e8 ether)
|
||||
sellerBalance[
|
||||
l.sellerKey][ERC20(l.token)
|
||||
] & BITMASK_SB_ENTRY;
|
||||
|
||||
if (
|
||||
(_sellerBalance + l.amount)
|
||||
> 1e8 ether
|
||||
)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
sellerBalance[l.sellerKey][ERC20(l.token)] += l.amount;
|
||||
sellerBalance[
|
||||
l.sellerKey][ERC20(l.token)
|
||||
] += l.amount;
|
||||
|
||||
l.amount = 0;
|
||||
|
||||
uint256 userKey = _castAddrToKey(
|
||||
l.relayerAddress
|
||||
);
|
||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||
1);
|
||||
uint256 userKey =
|
||||
_castAddrToKey(l.relayerAddress);
|
||||
uint256 _newUserRecord =
|
||||
(userRecord[userKey] >> 1);
|
||||
|
||||
if (_newUserRecord <= 1e2 ether) {
|
||||
userRecord[userKey] = 1e2 ether;
|
||||
} else {
|
||||
userRecord[userKey] = _newUserRecord;
|
||||
}
|
||||
emit LockReturned(l.buyerAddress, lockIDs[i]);
|
||||
emit LockReturned(
|
||||
l.buyerAddress,
|
||||
lockIDs[i]
|
||||
);
|
||||
|
||||
unchecked {
|
||||
++i;
|
||||
@@ -466,11 +501,11 @@ contract P2PIX is
|
||||
/// @dev Function sighash: 0x36317972.
|
||||
function withdraw(
|
||||
ERC20 token,
|
||||
bytes32[] calldata expiredLocks
|
||||
)
|
||||
public
|
||||
nonReentrant
|
||||
returns(uint256 _sellerBalance)
|
||||
uint256 amount,
|
||||
uint256[] calldata expiredLocks
|
||||
)
|
||||
public
|
||||
nonReentrant
|
||||
{
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
@@ -478,37 +513,35 @@ contract P2PIX is
|
||||
== true
|
||||
) {
|
||||
setValidState(token, false);
|
||||
}
|
||||
}
|
||||
|
||||
uint256 key =
|
||||
_castAddrToKey(msg.sender);
|
||||
_decBal(
|
||||
(sellerBalance[key][token]
|
||||
& BITMASK_SB_ENTRY),
|
||||
amount,
|
||||
token,
|
||||
key
|
||||
);
|
||||
|
||||
sellerBalance[key][token] -=
|
||||
(_sellerBalance =
|
||||
sellerBalance[key][token]
|
||||
& BITMASK_SB_ENTRY);
|
||||
|
||||
if(_sellerBalance == 0)
|
||||
revert InvalidDeposit();
|
||||
// safeTransfer tokens to seller
|
||||
SafeTransferLib.safeTransfer(
|
||||
token,
|
||||
msg.sender,
|
||||
amount
|
||||
);
|
||||
|
||||
// safeTransfer tokens to seller
|
||||
SafeTransferLib.safeTransfer(
|
||||
token,
|
||||
msg.sender,
|
||||
_sellerBalance
|
||||
);
|
||||
|
||||
emit DepositWithdrawn(
|
||||
msg.sender,
|
||||
address(token),
|
||||
_sellerBalance
|
||||
);
|
||||
emit DepositWithdrawn(
|
||||
msg.sender,
|
||||
address(token),
|
||||
amount
|
||||
);
|
||||
}
|
||||
|
||||
function setRoot(
|
||||
address addr,
|
||||
bytes32 merkleroot
|
||||
) public {
|
||||
function setRoot(address addr, bytes32 merkleroot)
|
||||
public
|
||||
{
|
||||
if (addr == msg.sender) {
|
||||
sellerAllowList[
|
||||
_castAddrToKey(addr)
|
||||
@@ -527,27 +560,30 @@ contract P2PIX is
|
||||
emit FundsWithdrawn(msg.sender, balance);
|
||||
}
|
||||
|
||||
function setReputation(
|
||||
IReputation _reputation
|
||||
) public onlyOwner {
|
||||
function setReputation(IReputation _reputation)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
assembly {
|
||||
sstore(reputation.slot, _reputation)
|
||||
}
|
||||
emit ReputationUpdated(address(_reputation));
|
||||
}
|
||||
|
||||
function setDefaultLockBlocks(
|
||||
uint256 _blocks
|
||||
) public onlyOwner {
|
||||
function setDefaultLockBlocks(uint256 _blocks)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
assembly {
|
||||
sstore(defaultLockBlocks.slot, _blocks)
|
||||
}
|
||||
emit LockBlocksUpdated(_blocks);
|
||||
}
|
||||
|
||||
function setValidSigners(
|
||||
address[] memory _validSigners
|
||||
) public onlyOwner {
|
||||
function setValidSigners(address[] memory _validSigners)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
unchecked {
|
||||
uint256 i;
|
||||
uint256 len = _validSigners.length;
|
||||
@@ -623,33 +659,14 @@ contract P2PIX is
|
||||
function _addLock(
|
||||
uint256 _bal,
|
||||
uint256 _amount,
|
||||
bytes32 _lockID,
|
||||
uint256 _lockID,
|
||||
DT.Lock memory _l,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) internal {
|
||||
|
||||
mapLocks[_lockID] = _l;
|
||||
|
||||
assembly {
|
||||
if iszero(
|
||||
iszero(
|
||||
or(
|
||||
iszero(_bal),
|
||||
lt(
|
||||
sub(
|
||||
_bal,
|
||||
_amount),
|
||||
0x0
|
||||
)))) {
|
||||
// DecOverflow()
|
||||
mstore(0x00, 0xce3a3d37)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
}
|
||||
|
||||
// we can directly dec from packed uint entry value
|
||||
sellerBalance[_k][_t] -= _amount;
|
||||
|
||||
_decBal(_bal, _amount, _t, _k);
|
||||
|
||||
emit LockAdded(
|
||||
_l.buyerAddress,
|
||||
@@ -657,61 +674,8 @@ contract P2PIX is
|
||||
_l.sellerKey,
|
||||
_l.amount
|
||||
);
|
||||
|
||||
/// @todo
|
||||
// assembly {
|
||||
// // sstore(mp.slot, _l)
|
||||
// mstore(0x00, _k)
|
||||
// mstore(0x20, sellerBalance.slot)
|
||||
// let sbkslot := keccak256(0x00, 0x40)
|
||||
// mstore(0x00, _t)
|
||||
// mstore(0x20, sbkslot)
|
||||
// let sbslot := keccak256(0x00,0x40)
|
||||
// let oldsb := sload(sbslot)
|
||||
// sstore(
|
||||
// sbslot,
|
||||
// or(
|
||||
// or(
|
||||
// _newBal,
|
||||
// shr(
|
||||
// oldsb,
|
||||
// BITPOS_PIXTARGET
|
||||
// )),
|
||||
// and(
|
||||
// shr(
|
||||
// oldsb,
|
||||
// BITPOS_VALID
|
||||
// ),
|
||||
// BITMASK_SB_ENTRY
|
||||
// )
|
||||
// )
|
||||
// )
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
/// @notice Private view auxiliar logic that encodes/returns
|
||||
/// the `bytes32` identifier of an lock.
|
||||
/// @dev reverts on a not expired lock with the same ID passed
|
||||
/// as argument of the function.
|
||||
/// @dev Called exclusively by the `lock` method.
|
||||
/// @dev Function sighash: 0x3fc5fb52.
|
||||
// function _encodeLockID(
|
||||
// uint256 _lockCounter,
|
||||
// uint256 _amount,
|
||||
// address _buyerAddress
|
||||
// ) private view returns (bytes32 _lockID) {
|
||||
// _lockID = keccak256(
|
||||
// abi.encodePacked(
|
||||
// _lockCounter,
|
||||
// _amount,
|
||||
// _buyerAddress
|
||||
// )
|
||||
// );
|
||||
// if (mapLocks[_lockID].expirationBlock >= block.number)
|
||||
// revert NotExpired();
|
||||
// }
|
||||
|
||||
function merkleVerify(
|
||||
bytes32[] calldata _merkleProof,
|
||||
bytes32 root,
|
||||
@@ -726,9 +690,11 @@ contract P2PIX is
|
||||
) revert AddressDenied();
|
||||
}
|
||||
|
||||
function _limiter(
|
||||
uint256 _userCredit
|
||||
) internal view returns (uint256 _spendLimit) {
|
||||
function _limiter(uint256 _userCredit)
|
||||
internal
|
||||
view
|
||||
returns (uint256 _spendLimit)
|
||||
{
|
||||
// enconde the fx sighash and args
|
||||
bytes memory encodedParams = abi.encodeWithSelector(
|
||||
IReputation.limiter.selector,
|
||||
@@ -766,80 +732,164 @@ contract P2PIX is
|
||||
}
|
||||
|
||||
function _castToUint(
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid)
|
||||
private
|
||||
pure
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid
|
||||
)
|
||||
private
|
||||
pure
|
||||
returns (
|
||||
uint256 _amountCasted,
|
||||
uint256 _pixTargetCasted,
|
||||
uint256 _amountCasted,
|
||||
uint256 _pixTargetCasted,
|
||||
uint256 _validCasted
|
||||
) {
|
||||
assembly {
|
||||
_amountCasted := _amount
|
||||
_pixTargetCasted := _pixTarget
|
||||
_validCasted := _valid
|
||||
)
|
||||
{
|
||||
assembly {
|
||||
_amountCasted := _amount
|
||||
_pixTargetCasted := _pixTarget
|
||||
_validCasted := _valid
|
||||
}
|
||||
}
|
||||
|
||||
function _decBal(
|
||||
uint256 _bal,
|
||||
uint256 _amount,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) private {
|
||||
assembly {
|
||||
if iszero(
|
||||
iszero(
|
||||
or(
|
||||
iszero(_bal),
|
||||
lt(sub(_bal, _amount), 0x0)
|
||||
)
|
||||
)
|
||||
) {
|
||||
// DecOverflow()
|
||||
mstore(0x00, 0xce3a3d37)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
}
|
||||
|
||||
function getBalance(
|
||||
address seller,
|
||||
ERC20 token
|
||||
)
|
||||
public
|
||||
view
|
||||
returns(uint256 bal)
|
||||
{
|
||||
bal =
|
||||
sellerBalance[
|
||||
_castAddrToKey(seller)
|
||||
][token] & BITMASK_SB_ENTRY;
|
||||
// we can directly dec from packed uint entry value
|
||||
sellerBalance[_k][_t] -= _amount;
|
||||
}
|
||||
|
||||
function getValid(
|
||||
address seller,
|
||||
ERC20 token
|
||||
)
|
||||
public
|
||||
view
|
||||
returns(bool valid)
|
||||
function getBalance(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (uint256 bal)
|
||||
{
|
||||
uint256 b =
|
||||
(sellerBalance[
|
||||
_castAddrToKey(seller)
|
||||
][token] >> BITPOS_VALID) & BITMASK_SB_ENTRY;
|
||||
assembly { valid := b }
|
||||
// bal =
|
||||
// sellerBalance[_castAddrToKey(seller)][token] &
|
||||
// BITMASK_SB_ENTRY;
|
||||
assembly {
|
||||
for {/* */} iszero(0x0) {/* */} {
|
||||
mstore(0x00, shl(0xC,seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
bal := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
sload(keccak256(0x00,0x40)
|
||||
)) break
|
||||
}}
|
||||
}
|
||||
|
||||
function getPixTarget(
|
||||
address seller,
|
||||
function getValid(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (bool valid)
|
||||
{
|
||||
// uint256 b = sellerBalance[
|
||||
// _castAddrToKey(seller)
|
||||
// ][token];
|
||||
// ] >> BITPOS_VALID) & BITMASK_SB_ENTRY;
|
||||
assembly {
|
||||
for {/* */} iszero(0x0) {/* */} {
|
||||
mstore(0x00, shl(0xC,seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
valid := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
shr(
|
||||
BITPOS_VALID,
|
||||
sload(keccak256(0x00,0x40)
|
||||
))) break
|
||||
}}
|
||||
}
|
||||
|
||||
function getPixTarget(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (uint160 pixTarget)
|
||||
{
|
||||
// pixTarget = uint160(
|
||||
// sellerBalance[_castAddrToKey(seller)][token] >>
|
||||
// BITPOS_PIXTARGET
|
||||
// );
|
||||
assembly {
|
||||
for {/* */} iszero(0) {/* */} {
|
||||
mstore(0,shl(12,seller))
|
||||
mstore(32,sellerBalance.slot)
|
||||
let sbkslot := keccak256(0,64)
|
||||
mstore(0,token)
|
||||
mstore(32,sbkslot)
|
||||
pixTarget := shr(
|
||||
BITPOS_PIXTARGET,
|
||||
sload(keccak256(0,64)
|
||||
)) break
|
||||
}}
|
||||
}
|
||||
|
||||
function getBalances(
|
||||
address[] memory sellers,
|
||||
ERC20 token
|
||||
)
|
||||
public
|
||||
external
|
||||
view
|
||||
returns(uint160 pixTarget)
|
||||
returns(uint256[] memory balances)
|
||||
{
|
||||
pixTarget =
|
||||
uint160(
|
||||
sellerBalance[
|
||||
_castAddrToKey(seller)
|
||||
][token] >> BITPOS_PIXTARGET
|
||||
);
|
||||
if(address(token) == address(0x0))
|
||||
revert NoTokens();
|
||||
if(sellers.length == 0)
|
||||
revert LengthMismatch();
|
||||
|
||||
uint256 j;
|
||||
uint256 len = sellers.length;
|
||||
while (j < len) { balances[j] =
|
||||
getBalance(sellers[j], token);
|
||||
}
|
||||
|
||||
return balances;
|
||||
}
|
||||
|
||||
/// @notice Public method that handles `address`
|
||||
/// to `uint256` safe type casting.
|
||||
/// @dev Function sighash: 0x4b2ae980.
|
||||
function _castAddrToKey(
|
||||
address _addr
|
||||
) public pure returns (uint256 _key) {
|
||||
_key = uint256(uint160(address(_addr))) << 12;
|
||||
function _castAddrToKey(address _addr)
|
||||
public
|
||||
pure
|
||||
returns (uint256 _key)
|
||||
{
|
||||
// _key = uint256(uint160(address(_addr))) << 12;
|
||||
assembly {
|
||||
_key := shl(12,_addr)
|
||||
}
|
||||
}
|
||||
|
||||
function _castKeyToAddr(
|
||||
uint256 _key
|
||||
) public pure returns (address _addr) {
|
||||
_addr = address(uint160(uint256(_key >> 12)));
|
||||
function _castKeyToAddr(uint256 _key)
|
||||
public
|
||||
pure
|
||||
returns (address _addr)
|
||||
{
|
||||
// _addr = address(uint160(uint256(_key >> 12)));
|
||||
assembly {
|
||||
_addr := shr(12,_key)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"signers": [
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
||||
],
|
||||
"p2pix": "0x2a54667b566B1Aa3779828720E6696AC18ae3f1b",
|
||||
"token": "0x4A2886EAEc931e04297ed336Cc55c4eb7C75BA00"
|
||||
}
|
||||
@@ -3,6 +3,6 @@
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
||||
],
|
||||
"p2pix": "0x37c856F4d5bC2597da60f607b1335738468453F3",
|
||||
"token": "0x294003F602c321627152c6b7DED3EAb5bEa853Ee"
|
||||
}
|
||||
"p2pix": "0xC86042E9F2977C62Da8c9dDF7F9c40fde4796A29",
|
||||
"token": "0xD38D6367f452D097ccBfDe4490b7de570B6A72Db"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"signers": [
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
||||
],
|
||||
"p2pix": "0x7F4680D114B43c4434FB604c7Bc6306125D32f28",
|
||||
"token": "0xC86042E9F2977C62Da8c9dDF7F9c40fde4796A29"
|
||||
}
|
||||
+601
-420
File diff suppressed because it is too large.
Load diff
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 66 KiB |
+23
-6
@@ -21,11 +21,21 @@ if (!infuraApiKey) {
|
||||
);
|
||||
}
|
||||
|
||||
const alchemyApiKey: string | undefined =
|
||||
process.env.ALCHEMY_API_KEY;
|
||||
if (!alchemyApiKey) {
|
||||
throw new Error(
|
||||
"Please set your ALCHEMY_API_KEY in a .env file",
|
||||
);
|
||||
}
|
||||
|
||||
const chainIds = {
|
||||
// "{INSERT_NAME}": {INSERT_ID},
|
||||
hardhat: 31337,
|
||||
mainnet: 1,
|
||||
sepolia: 11155111,
|
||||
goerli : 5,
|
||||
"polygon-mumbai": 80001,
|
||||
};
|
||||
|
||||
function getChainConfig(
|
||||
@@ -33,9 +43,9 @@ function getChainConfig(
|
||||
): NetworkUserConfig {
|
||||
let jsonRpcUrl: string;
|
||||
switch (chain) {
|
||||
// case "{INSERT_NAME}":
|
||||
// jsonRpcUrl = "{INSERT_URL}";
|
||||
// break;
|
||||
case "polygon-mumbai":
|
||||
jsonRpcUrl = "https://polygon-mumbai.g.alchemy.com/v2/" + alchemyApiKey;
|
||||
break;
|
||||
default:
|
||||
jsonRpcUrl =
|
||||
"https://" + chain + ".infura.io/v3/" + infuraApiKey;
|
||||
@@ -47,6 +57,7 @@ function getChainConfig(
|
||||
mnemonic,
|
||||
path: "m/44'/60'/0'/0",
|
||||
},
|
||||
// gasPrice: 8000000000,
|
||||
chainId: chainIds[chain],
|
||||
url: jsonRpcUrl,
|
||||
};
|
||||
@@ -58,6 +69,8 @@ const config: HardhatUserConfig = {
|
||||
apiKey: {
|
||||
mainnet: process.env.ETHERSCAN_API_KEY || "",
|
||||
rinkeby: process.env.ETHERSCAN_API_KEY || "",
|
||||
goerli: process.env.ETHERSCAN_API_KEY || "",
|
||||
polygonMumbai: process.env.POLYGONSCAN_API_KEY || "",
|
||||
},
|
||||
// customChains: [
|
||||
// {
|
||||
@@ -78,7 +91,7 @@ const config: HardhatUserConfig = {
|
||||
),
|
||||
showTimeSpent: true,
|
||||
showMethodSig: true,
|
||||
token: "ONE",
|
||||
token: "ETH",
|
||||
currency: "USD",
|
||||
// gasPriceApi: process.env.GASPRICE_API_ENDPOINT,
|
||||
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
|
||||
@@ -95,7 +108,9 @@ const config: HardhatUserConfig = {
|
||||
},
|
||||
// network: getChainConfig("{INSERT_NAME}"),
|
||||
mainnet: getChainConfig("mainnet"),
|
||||
goerli: getChainConfig("goerli"),
|
||||
sepolia: getChainConfig("sepolia"),
|
||||
"polygon-mumbai": getChainConfig("polygon-mumbai"),
|
||||
},
|
||||
paths: {
|
||||
artifacts: "./artifacts",
|
||||
@@ -106,12 +121,14 @@ const config: HardhatUserConfig = {
|
||||
solidity: {
|
||||
version: "0.8.9",
|
||||
settings: {
|
||||
// viaIR: true,
|
||||
metadata: {
|
||||
bytecodeHash: "none",
|
||||
},
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 800,
|
||||
// max val = 4_294_967_295
|
||||
runs: 20_000,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -121,4 +138,4 @@ const config: HardhatUserConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
export default config;
|
||||
+5
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "p2pix-smart-contracts",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0",
|
||||
"description": "Repository for P2Pix EVM contracts to be imported by the project.",
|
||||
"homepage": "https://github.com/doiim/p2pix-smart-contracts#readme",
|
||||
"author": "Filipe Soccol (doiim)",
|
||||
@@ -16,6 +16,10 @@
|
||||
"test": "hardhat test",
|
||||
"deploy1:localhost": "hardhat run scripts/1-deploy-mockToken.ts --network localhost",
|
||||
"deploy2:localhost": "hardhat run scripts/2-deploy-p2pix.ts --network localhost",
|
||||
"deploy1:goerli": "hardhat run scripts/1-deploy-mockToken.ts --network goerli",
|
||||
"deploy2:goerli": "hardhat run scripts/2-deploy-p2pix.ts --network goerli",
|
||||
"deploy1:mumbai": "hardhat run scripts/1-deploy-mockToken.ts --network polygon-mumbai",
|
||||
"deploy2:mumbai": "hardhat run scripts/2-deploy-p2pix.ts --network polygon-mumbai",
|
||||
"coverage": "hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"test/**/*.ts\" && yarn typechain",
|
||||
"lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check",
|
||||
"lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ethers, network } from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/fixtures";
|
||||
|
||||
// import hre from "hardhat";
|
||||
import hre from "hardhat";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
const supply: BigNumber = ethers.utils.parseEther("20000000");
|
||||
@@ -34,18 +34,19 @@ const main = async () => {
|
||||
|
||||
deploysJson.token = erc20.address;
|
||||
console.log("🚀 Mock Token Deployed:", erc20.address);
|
||||
await erc20.deployTransaction.wait(6);
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
JSON.stringify(deploysJson, undefined, 2),
|
||||
);
|
||||
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET */
|
||||
//verify
|
||||
// await hre.run("verify:verify", {
|
||||
// address: erc20.address,
|
||||
// constructorArguments: supply,
|
||||
// });
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET/PUBLIC TESTNETS */
|
||||
// verify
|
||||
await hre.run("verify:verify", {
|
||||
address: erc20.address,
|
||||
constructorArguments: [supply],
|
||||
});
|
||||
};
|
||||
|
||||
main()
|
||||
@@ -53,4 +54,4 @@ main()
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
@@ -5,6 +5,8 @@ import { ethers, network } from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/fixtures";
|
||||
|
||||
import hre from "hardhat";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
|
||||
const main = async () => {
|
||||
@@ -40,18 +42,30 @@ const main = async () => {
|
||||
|
||||
deploysJson.p2pix = p2pix.address;
|
||||
console.log("🚀 P2PIX Deployed:", p2pix.address);
|
||||
await p2pix.deployTransaction.wait(6);
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
JSON.stringify(deploysJson, undefined, 2),
|
||||
);
|
||||
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET */
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET/PUBLIC TESTNETS */
|
||||
//verify
|
||||
// await hre.run("verify:verify", {
|
||||
// address: p2pix.address,
|
||||
// constructorArguments: [2, deploysJson.signers],
|
||||
// });
|
||||
await hre.run("verify:verify", {
|
||||
address: p2pix.address,
|
||||
constructorArguments:
|
||||
[
|
||||
10,
|
||||
deploysJson.signers,
|
||||
reputation.address,
|
||||
[deploysJson.token],
|
||||
[true],
|
||||
],
|
||||
});
|
||||
await hre.run("verify:verify", {
|
||||
address: reputation.address,
|
||||
constructorArguments: [],
|
||||
});
|
||||
};
|
||||
|
||||
main()
|
||||
@@ -59,4 +73,4 @@ main()
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
+21
-15
@@ -1,7 +1,13 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseContract, BigNumber, BytesLike, Signer, utils } from "ethers";
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type { EventFragment } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
@@ -20,10 +26,10 @@ export interface EventAndErrorsInterface extends utils.Interface {
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,bytes32,uint256,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,bytes32,uint256)": EventFragment;
|
||||
"LockReturned(address,bytes32)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
"ValidSet(address,address,bool)": EventFragment;
|
||||
@@ -94,12 +100,12 @@ export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber, BigNumber],
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
@@ -118,11 +124,11 @@ export type LockBlocksUpdatedEventFilter =
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
@@ -130,10 +136,10 @@ export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, string],
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
@@ -252,15 +258,15 @@ export interface EventAndErrors extends BaseContract {
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,bytes32,uint256,uint256)"(
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BytesLike> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BytesLike> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
@@ -268,7 +274,7 @@ export interface EventAndErrors extends BaseContract {
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,bytes32,uint256)"(
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
@@ -279,7 +285,7 @@ export interface EventAndErrors extends BaseContract {
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,bytes32)"(
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
|
||||
@@ -209,9 +209,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
@@ -253,9 +253,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
@@ -278,9 +278,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
|
||||
@@ -105,7 +105,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a35061036b806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100dc57600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102a6565b6100e8565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac3660046102d6565b6101a9565b6000546100c4906001600160a01b031681565b6040516001600160a01b039091168152602001610095565b61008b643a3529440081565b6000546001600160a01b031633146101465760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b60006101cc6101b88380610305565b6101c790643a35294400610324565b6101f4565b6101d983620f4240610305565b6101e3919061033c565b6101ee906001610324565b92915050565b60b58171010000000000000000000000000000000000811061021b5760409190911b9060801c5b690100000000000000000081106102375760209190911b9060401c5b65010000000000811061024f5760109190911b9060201c5b630100000081106102655760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b6000602082840312156102b857600080fd5b81356001600160a01b03811681146102cf57600080fd5b9392505050565b6000602082840312156102e857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561031f5761031f6102ef565b500290565b60008219821115610337576103376102ef565b500190565b60008261035957634e487b7160e01b600052601260045260246000fd5b50049056fea164736f6c6343000809000a";
|
||||
"0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350610416806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a";
|
||||
|
||||
type ReputationConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
||||
@@ -346,7 +346,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60e06040523480156200001157600080fd5b506040516200105238038062001052833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610c87620003cb60003960006104630152600061042e015260006101540152610c876000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190Line truncated
|
||||
"0x60e06040523480156200001157600080fd5b506040516200129938038062001299833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610ece620003cb60003960006104c20152600061048d015260006101540152610ece6000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906109f2565b60405180910390f35b610115610110366004610a8e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610ab8565b610345565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e610489565b61012e61019e366004610af4565b60036020526000908152604090205481565b61012e6101be366004610af4565b60056020526000908152604090205481565b6100ec6104e4565b6101156101e6366004610a8e565b6104f1565b6101fe6101f9366004610b16565b610576565b005b61012e61020e366004610b89565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610beb565b61089a565b6000805461024b90610cd4565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610cd4565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103349086815260200190565b60405180910390a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526004602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146103d9576103a78382610d57565b73ffffffffffffffffffffffffffffffffffffffff861660009081526004602090815260408083203384529091529020555b73ffffffffffffffffffffffffffffffffffffffff85166000908152600360205260408120805485929061040e908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104769087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104bf576104ba6108e0565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610cd4565b33600090815260036020526040812080548391908390610512908490610d57565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103349086815260200190565b428410156105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b600060016105f1610489565b73ffffffLine truncated
|
||||
|
||||
type MockTokenConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/* 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 { Counters, CountersInterface } from "../../../lib/utils/Counters";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a";
|
||||
|
||||
type CountersConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: CountersConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class Counters__factory extends ContractFactory {
|
||||
constructor(...args: CountersConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<Counters> {
|
||||
return super.deploy(overrides || {}) as Promise<Counters>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): Counters {
|
||||
return super.attach(address) as Counters;
|
||||
}
|
||||
override connect(signer: Signer): Counters__factory {
|
||||
return super.connect(signer) as Counters__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): CountersInterface {
|
||||
return new utils.Interface(_abi) as CountersInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): Counters {
|
||||
return new Contract(address, _abi, signerOrProvider) as Counters;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { Counters__factory } from "./Counters__factory";
|
||||
export { ReentrancyGuard__factory } from "./ReentrancyGuard__factory";
|
||||
@@ -249,9 +249,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
@@ -293,9 +293,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
@@ -318,9 +318,9 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
@@ -555,6 +555,30 @@ const _abi = [
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "sellers",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "getBalances",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256[]",
|
||||
name: "balances",
|
||||
type: "uint256[]",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
@@ -641,17 +665,17 @@ const _abi = [
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
internalType: "uint256[]",
|
||||
name: "expiredLocks",
|
||||
type: "bytes32[]",
|
||||
type: "uint256[]",
|
||||
},
|
||||
],
|
||||
name: "lock",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "lockID",
|
||||
type: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
@@ -673,9 +697,9 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "mapLocks",
|
||||
@@ -750,9 +774,9 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "bytes32",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "address",
|
||||
@@ -950,9 +974,9 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
internalType: "uint256[]",
|
||||
name: "lockIDs",
|
||||
type: "bytes32[]",
|
||||
type: "uint256[]",
|
||||
},
|
||||
],
|
||||
name: "unlockExpired",
|
||||
@@ -1025,19 +1049,18 @@ const _abi = [
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256[]",
|
||||
name: "expiredLocks",
|
||||
type: "bytes32[]",
|
||||
type: "uint256[]",
|
||||
},
|
||||
],
|
||||
name: "withdraw",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_sellerBalance",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
@@ -1055,7 +1078,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60806040526001805560405162002aa438038062002aa48339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806003557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600860205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083018260051b82015b8083146200037f578251600052600a60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b61247480620006306000396000f3fe6080604052600436106101d15760003560e01c80637f94f65d116100f75780639872dbfe11610095578063c52164c611610064578063c52164c6146106cc578063d4fac45d146106ec578063d6e8b9731461074b578063f7d0e04b1461076b57600080fd5b80639872dbfe146105fa57806398a26871146106105780639eee8d4b14610640578063ad8f2eed1461067857600080fd5b806385313e73116100d157806385313e73146105845780638da5cb5b146105a45780638db564c2146105c45780638e2749d6146105da57600080fd5b80637f94f65d146104d757806380e1d302146104f757806384ab1d281461054b57600080fd5b80634b2ae9801161016f5780636a1460241161013e5780636a1460241461044e5780636d82d9e01461046a578063758d77d41461048a57806377cd38a4146104aa57600080fd5b80634b2ae980146103be578063574983c8146103e95780635fd8c7101461040957806369cc6af41461041e57600080fd5b806316d72240116101ab57806316d722401461025f5780632b9f00e91461033e578063328a71811461035e578063461f31201461037e57600080fd5b806304937320146101dd5780630d2a2d441461021d57806313af40351461023f57600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5061020a6101f8366004611ddb565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561022957600080fd5b5061023d610238366004611ee8565b61078b565b005b34801561024b57600080fd5b5061023d61025a366004611f25565b61087c565b34801561026b57600080fd5b506102df61027a366004611ddb565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006860154600787015460088801546009909801549698959794969395946001600160a01b0393841694928416939182169290821691168a565b604080519a8b5260208b019990995297890196909652606088019490945260808701929092526001600160a01b0390811660a087015290811660c086015290811660e08501529081166101008401521661012082015261014001610214565b34801561034a57600080fd5b5061020a610359366004611f8e565b61091d565b34801561036a57600080fd5b5061023d610379366004612074565b610c90565b34801561038a57600080fd5b506103ae6103Line truncated
|
||||
"0x6080604052600180556040516200322a3803806200322a8339810160408190526200002a9162000493565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000616565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806003557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005b1565b60200260200101516200038760201b60201c565b6000908152600860205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005c7565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083018260051b82015b8083146200037f578251600052600a60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b90565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003ce57620003ce6200038d565b604052919050565b60006001600160401b03821115620003f257620003f26200038d565b5060051b60200190565b6001600160a01b03811681146200041257600080fd5b50565b600082601f8301126200042757600080fd5b81516020620004406200043a83620003d6565b620003a3565b82815260059290921b840181019181810190868411156200046057600080fd5b8286015b84811015620004885780516200047a81620003fc565b835291830191830162000464565b509695505050505050565b600080600080600060a08688031215620004ac57600080fd5b8551602080880151919650906001600160401b0380821115620004ce57600080fd5b620004dc8a838b0162000415565b965060408901519150620004f082620003fc565b6060890151919550808211156200050657600080fd5b620005148a838b0162000415565b945060808901519150808211156200052b57600080fd5b508701601f810189136200053e57600080fd5b80516200054f6200043a82620003d6565b81815260059190911b8201830190838101908b8311156200056f57600080fd5b928401925b828410156200059f57835180151581146200058f5760008081fd5b8252928401929084019062000574565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b818110156200060a5783516001600160a01b031683529284019291840191600101620005e3565b50909695505050505050565b612c0480620006266000396000f3fe6080604052600436106101dc5760003560e01c80637f94f65d11610102578063ad8f2eed11610095578063d4fac45d11610064578063d4fac45d14610713578063d6e8b9731461075e578063f7d0e04b1461077e578063fb8c5ef01461079e57600080fd5b8063ad8f2eed14610659578063b0983d3914610699578063c52164c6146106b9578063d1c07028146106e657600080fd5b80638db564c2116100d15780638db564c2146105c55780639872dbfe146105db57806398a26871146105f15780639eee8d4b1461062157600080fd5b80637f94f65d146104f257806380e1d3021461051257806384ab1d28146105525780638da5cb5b1461059857600080fd5b80634b2ae9801161017a5780636a146024116101495780636a146024146104695780636d82d9e01461048557806374ba03a0146104a557806377cd38a4146104c557600080fd5b80634b2ae980146103e3578063574983c8146104045780635fd8c7101461042457806369cc6af41461043957600080fd5b806313af4035116101b657806313af40351461026a578063328a71811461028a578063367821f0146102aa578063461f3120146103a357600080fd5b806304937320146101e85780630a98b9bd146102285780630d2a2d441461024857600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610215610203366004612406565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561023457600080fd5b5061021561024336600461248d565b6107be565b34801561025457600080fd5b50610268610263366004612674565b610b6d565b005b34801561027657600080fd5b506102686102853660046126b1565b610ca7565b34801561029657600080fd5b506102686102a53660046126ea565b610d98565b3480156102b657600080fd5b506103376102c5366004612406565b6005602081905260009182526040909120805460018201546002830154600384015460048501549585015460068601546007870154600888015460099098015496989597949693959473ffffffffffffffffffffffffffffffffffffffff93841694928416939182169290821691168a565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925273ffffffffffffffffffffffffffffffffffffffff90811660a087015290811660c086015290811660e085015290811661010084015216610120820152Line truncated
|
||||
|
||||
type P2PIXConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
||||
Vendored
-9
@@ -32,10 +32,6 @@ declare module "hardhat/types/runtime" {
|
||||
name: "ERC20",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ERC20__factory>;
|
||||
getContractFactory(
|
||||
name: "Counters",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.Counters__factory>;
|
||||
getContractFactory(
|
||||
name: "ReentrancyGuard",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
@@ -74,11 +70,6 @@ declare module "hardhat/types/runtime" {
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ERC20>;
|
||||
getContractAt(
|
||||
name: "Counters",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.Counters>;
|
||||
getContractAt(
|
||||
name: "ReentrancyGuard",
|
||||
address: string,
|
||||
|
||||
@@ -17,8 +17,6 @@ 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 { Counters } from "./lib/utils/Counters";
|
||||
export { Counters__factory } from "./factories/lib/utils/Counters__factory";
|
||||
export type { ReentrancyGuard } from "./lib/utils/ReentrancyGuard";
|
||||
export { ReentrancyGuard__factory } from "./factories/lib/utils/ReentrancyGuard__factory";
|
||||
export type { P2PIX } from "./p2pix.sol/P2PIX";
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/* 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 CountersInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface Counters extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: CountersInterface;
|
||||
|
||||
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,5 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { Counters } from "./Counters";
|
||||
export type { ReentrancyGuard } from "./ReentrancyGuard";
|
||||
+100
-51
@@ -36,13 +36,14 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
"defaultLockBlocks()": FunctionFragment;
|
||||
"deposit(address,uint96,uint160,bool,bytes32)": FunctionFragment;
|
||||
"getBalance(address,address)": FunctionFragment;
|
||||
"getBalances(address[],address)": FunctionFragment;
|
||||
"getPixTarget(address,address)": FunctionFragment;
|
||||
"getValid(address,address)": FunctionFragment;
|
||||
"lock(address,address,address,address,uint256,uint256,bytes32[],bytes32[])": FunctionFragment;
|
||||
"lock(address,address,address,address,uint256,uint256,bytes32[],uint256[])": FunctionFragment;
|
||||
"lockCounter()": FunctionFragment;
|
||||
"mapLocks(bytes32)": FunctionFragment;
|
||||
"mapLocks(uint256)": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"release(bytes32,address,bytes32,bytes32,bytes32,uint8)": FunctionFragment;
|
||||
"release(uint256,address,bytes32,bytes32,bytes32,uint8)": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"sellerBalance(uint256,address)": FunctionFragment;
|
||||
@@ -53,11 +54,11 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
"setValidSigners(address[])": FunctionFragment;
|
||||
"setValidState(address,bool)": FunctionFragment;
|
||||
"tokenSettings(address[],bool[])": FunctionFragment;
|
||||
"unlockExpired(bytes32[])": FunctionFragment;
|
||||
"unlockExpired(uint256[])": FunctionFragment;
|
||||
"usedTransactions(bytes32)": FunctionFragment;
|
||||
"userRecord(uint256)": FunctionFragment;
|
||||
"validBacenSigners(uint256)": FunctionFragment;
|
||||
"withdraw(address,bytes32[])": FunctionFragment;
|
||||
"withdraw(address,uint256,uint256[])": FunctionFragment;
|
||||
"withdrawBalance()": FunctionFragment;
|
||||
};
|
||||
|
||||
@@ -70,6 +71,7 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
| "defaultLockBlocks"
|
||||
| "deposit"
|
||||
| "getBalance"
|
||||
| "getBalances"
|
||||
| "getPixTarget"
|
||||
| "getValid"
|
||||
| "lock"
|
||||
@@ -126,6 +128,10 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
functionFragment: "getBalance",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getBalances",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getPixTarget",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<string>]
|
||||
@@ -144,7 +150,7 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BytesLike>[],
|
||||
PromiseOrValue<BytesLike>[]
|
||||
PromiseOrValue<BigNumberish>[]
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
@@ -153,13 +159,13 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "mapLocks",
|
||||
values: [PromiseOrValue<BytesLike>]
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "release",
|
||||
values: [
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
@@ -209,7 +215,7 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "unlockExpired",
|
||||
values: [PromiseOrValue<BytesLike>[]]
|
||||
values: [PromiseOrValue<BigNumberish>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "usedTransactions",
|
||||
@@ -225,7 +231,11 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdraw",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<BytesLike>[]]
|
||||
values: [
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>[]
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdrawBalance",
|
||||
@@ -251,6 +261,10 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "getBalance", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getBalances",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getPixTarget",
|
||||
data: BytesLike
|
||||
@@ -319,10 +333,10 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,bytes32,uint256,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,bytes32,uint256)": EventFragment;
|
||||
"LockReturned(address,bytes32)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
@@ -395,12 +409,12 @@ export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber, BigNumber],
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
@@ -419,11 +433,11 @@ export type LockBlocksUpdatedEventFilter =
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
@@ -431,10 +445,10 @@ export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, string],
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
@@ -557,6 +571,12 @@ export interface P2PIX extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { bal: BigNumber }>;
|
||||
|
||||
getBalances(
|
||||
sellers: PromiseOrValue<string>[],
|
||||
token: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber[]] & { balances: BigNumber[] }>;
|
||||
|
||||
getPixTarget(
|
||||
seller: PromiseOrValue<string>,
|
||||
token: PromiseOrValue<string>,
|
||||
@@ -577,14 +597,14 @@ export interface P2PIX extends BaseContract {
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
lockCounter(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
mapLocks(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<
|
||||
[
|
||||
@@ -615,7 +635,7 @@ export interface P2PIX extends BaseContract {
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BytesLike>,
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
@@ -676,7 +696,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
unlockExpired(
|
||||
lockIDs: PromiseOrValue<BytesLike>[],
|
||||
lockIDs: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@@ -697,7 +717,8 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@@ -740,6 +761,12 @@ export interface P2PIX extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getBalances(
|
||||
sellers: PromiseOrValue<string>[],
|
||||
token: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber[]>;
|
||||
|
||||
getPixTarget(
|
||||
seller: PromiseOrValue<string>,
|
||||
token: PromiseOrValue<string>,
|
||||
@@ -760,14 +787,14 @@ export interface P2PIX extends BaseContract {
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
lockCounter(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
mapLocks(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<
|
||||
[
|
||||
@@ -798,7 +825,7 @@ export interface P2PIX extends BaseContract {
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BytesLike>,
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
@@ -859,7 +886,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
unlockExpired(
|
||||
lockIDs: PromiseOrValue<BytesLike>[],
|
||||
lockIDs: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@@ -880,7 +907,8 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@@ -923,6 +951,12 @@ export interface P2PIX extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getBalances(
|
||||
sellers: PromiseOrValue<string>[],
|
||||
token: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber[]>;
|
||||
|
||||
getPixTarget(
|
||||
seller: PromiseOrValue<string>,
|
||||
token: PromiseOrValue<string>,
|
||||
@@ -943,14 +977,14 @@ export interface P2PIX extends BaseContract {
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
): Promise<BigNumber>;
|
||||
|
||||
lockCounter(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
mapLocks(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<
|
||||
[
|
||||
@@ -981,7 +1015,7 @@ export interface P2PIX extends BaseContract {
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BytesLike>,
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
@@ -1042,7 +1076,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<void>;
|
||||
|
||||
unlockExpired(
|
||||
lockIDs: PromiseOrValue<BytesLike>[],
|
||||
lockIDs: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
@@ -1063,9 +1097,10 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
): Promise<void>;
|
||||
|
||||
withdrawBalance(overrides?: CallOverrides): Promise<void>;
|
||||
};
|
||||
@@ -1108,15 +1143,15 @@ export interface P2PIX extends BaseContract {
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,bytes32,uint256,uint256)"(
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BytesLike> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BytesLike> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
@@ -1124,7 +1159,7 @@ export interface P2PIX extends BaseContract {
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,bytes32,uint256)"(
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
@@ -1135,7 +1170,7 @@ export interface P2PIX extends BaseContract {
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,bytes32)"(
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
@@ -1216,6 +1251,12 @@ export interface P2PIX extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getBalances(
|
||||
sellers: PromiseOrValue<string>[],
|
||||
token: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getPixTarget(
|
||||
seller: PromiseOrValue<string>,
|
||||
token: PromiseOrValue<string>,
|
||||
@@ -1236,21 +1277,21 @@ export interface P2PIX extends BaseContract {
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
lockCounter(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
mapLocks(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BytesLike>,
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
@@ -1311,7 +1352,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
unlockExpired(
|
||||
lockIDs: PromiseOrValue<BytesLike>[],
|
||||
lockIDs: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@@ -1332,7 +1373,8 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@@ -1376,6 +1418,12 @@ export interface P2PIX extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getBalances(
|
||||
sellers: PromiseOrValue<string>[],
|
||||
token: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getPixTarget(
|
||||
seller: PromiseOrValue<string>,
|
||||
token: PromiseOrValue<string>,
|
||||
@@ -1396,21 +1444,21 @@ export interface P2PIX extends BaseContract {
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
lockCounter(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
mapLocks(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BytesLike>,
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
@@ -1471,7 +1519,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
unlockExpired(
|
||||
lockIDs: PromiseOrValue<BytesLike>[],
|
||||
lockIDs: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
@@ -1492,7 +1540,8 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
expiredLocks: PromiseOrValue<BytesLike>[],
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
|
||||
+1866
-1774
File diff suppressed because it is too large.
Load diff
@@ -15,4 +15,8 @@ export enum P2PixErrors {
|
||||
AddressDenied = "AddressDenied",
|
||||
AmountNotAllowed = "AmountNotAllowed",
|
||||
LockExpired = "LockExpired",
|
||||
EmptyPixTarget = "EmptyPixTarget",
|
||||
MaxBalExceeded = "MaxBalExceeded",
|
||||
NotInitialized = "NotInitialized",
|
||||
DecOverflow = "DecOverflow",
|
||||
}
|
||||
+11
-8
@@ -17,22 +17,25 @@ export interface Deploys {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface Deposit {
|
||||
remaining: BigNumber;
|
||||
pixTarget: string;
|
||||
seller: string;
|
||||
token: string;
|
||||
valid: boolean;
|
||||
}
|
||||
// export interface Deposit {
|
||||
// remaining: BigNumber;
|
||||
// pixTarget: string;
|
||||
// seller: string;
|
||||
// token: string;
|
||||
// valid: boolean;
|
||||
// }
|
||||
|
||||
export interface Lock {
|
||||
depositID: BigNumber;
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerTarget: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface P2pixFixture {
|
||||
|
||||
Reference in new issue
Block a user