Compare commits
10 Commits
55409a960c
...
124abb35be
Author | SHA1 | Date | |
---|---|---|---|
|
124abb35be | ||
|
6c5b784782 | ||
|
ce5f3e4265 | ||
|
440048453b | ||
|
0b9b0307d2 | ||
|
545887baec | ||
|
d8147bd58e | ||
|
8ebef3aaf1 | ||
|
9d14f053d5 | ||
|
6a3bea432c |
@ -6,6 +6,7 @@
|
||||
|
||||
```rs
|
||||
./contracts/
|
||||
├── Constants.sol
|
||||
├── DataTypes.sol
|
||||
├── EventAndErrors.sol
|
||||
├── lib
|
||||
@ -18,7 +19,9 @@
|
||||
│ ├── tokens
|
||||
│ │ └── ERC20.sol
|
||||
│ └── utils
|
||||
│ ├── ECDSA.sol
|
||||
│ ├── MerkleProofLib.sol
|
||||
│ ├── Multicall.sol
|
||||
│ ├── ReentrancyGuard.sol
|
||||
│ └── SafeTransferLib.sol
|
||||
├── p2pix.sol
|
||||
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "DataTypes",
|
||||
"sourceName": "contracts/DataTypes.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -8,25 +8,6 @@
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@ -71,36 +52,10 @@
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350610416806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a",
|
||||
"bytecode": "0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033",
|
||||
"deployedBytecode": "0x6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
606
artifacts/contracts/core/BaseUtils.sol/BaseUtils.json
Normal file
606
artifacts/contracts/core/BaseUtils.sol/BaseUtils.json
Normal file
@ -0,0 +1,606 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "BaseUtils",
|
||||
"sourceName": "contracts/core/BaseUtils.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AddressDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AmountNotAllowed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EmptyPixTarget",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidDeposit",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSigner",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LengthMismatch",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LockExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LoopOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MaxBalExceeded",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NoTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotEnoughTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlySeller",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "StaticCallFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TxAlreadyUsed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "AllowedERC20Updated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "DepositAdded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "DepositWithdrawn",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "FundsWithdrawn",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "lockID",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "seller",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockAdded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockBlocksUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReleased",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReturned",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "ValidSet",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address[]",
|
||||
"name": "signers",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "ValidSignersUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "_castAddrToKey",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_key",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_key",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "_castKeyToAddr",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20",
|
||||
"name": "erc20",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowedERC20s",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "defaultLockBlocks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "reputation",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "sellerKey",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sellerAllowList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "setDefaultLockBlocks",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "_reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setReputation",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_validSigners",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "setValidSigners",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20[]",
|
||||
"name": "_tokens",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "_states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "tokenSettings",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "message",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "usedTransactions",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "used",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "signer",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "validBacenSigners",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "valid",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "withdrawBalance",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
10
artifacts/contracts/core/Constants.sol/Constants.json
Normal file
10
artifacts/contracts/core/Constants.sol/Constants.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Constants",
|
||||
"sourceName": "contracts/core/Constants.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
10
artifacts/contracts/core/DataTypes.sol/DataTypes.json
Normal file
10
artifacts/contracts/core/DataTypes.sol/DataTypes.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "DataTypes",
|
||||
"sourceName": "contracts/core/DataTypes.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212209226ebeaaf7b795b2ae23b66ef299a5f0c68da0ab93c77d38a95452bea1a6eaa64736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea26469706673582212209226ebeaaf7b795b2ae23b66ef299a5f0c68da0ab93c77d38a95452bea1a6eaa64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "EventAndErrors",
|
||||
"sourceName": "contracts/EventAndErrors.sol",
|
||||
"sourceName": "contracts/core/EventAndErrors.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
@ -23,11 +23,6 @@
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DepositAlreadyExists",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EmptyPixTarget",
|
||||
@ -133,7 +128,7 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
@ -158,7 +153,7 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
@ -296,13 +291,13 @@
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
@ -322,7 +317,7 @@
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
549
artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json
Normal file
549
artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json
Normal file
@ -0,0 +1,549 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "OwnerSettings",
|
||||
"sourceName": "contracts/core/OwnerSettings.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AddressDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AmountNotAllowed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EmptyPixTarget",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidDeposit",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSigner",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LengthMismatch",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LockExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LoopOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MaxBalExceeded",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NoTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotEnoughTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlySeller",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "StaticCallFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TxAlreadyUsed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "AllowedERC20Updated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "DepositAdded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "DepositWithdrawn",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "FundsWithdrawn",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "uint256",
|
||||
"name": "lockID",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "seller",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockAdded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockBlocksUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReleased",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "buyer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "lockId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "LockReturned",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "contract ERC20",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "ValidSet",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address[]",
|
||||
"name": "signers",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "ValidSignersUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20",
|
||||
"name": "erc20",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowedERC20s",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "defaultLockBlocks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "reputation",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "sellerKey",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sellerAllowList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "setDefaultLockBlocks",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "_reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setReputation",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_validSigners",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "setValidSigners",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20[]",
|
||||
"name": "_tokens",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "_states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "tokenSettings",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "signer",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "validBacenSigners",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "valid",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "withdrawBalance",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -3,6 +3,11 @@
|
||||
"contractName": "Owned",
|
||||
"sourceName": "contracts/lib/auth/Owned.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
4
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json
Normal file
4
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
16
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.json
Normal file
16
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ECDSA",
|
||||
"sourceName": "contracts/lib/utils/ECDSA.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSignature",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
"contractName": "MerkleProofLib",
|
||||
"sourceName": "contracts/lib/utils/MerkleProofLib.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220030f589a2a329a8fd0f451393f1e14e20eb0e1f782beb297fe6aade2ffebc0b564736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220030f589a2a329a8fd0f451393f1e14e20eb0e1f782beb297fe6aade2ffebc0b564736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -109,8 +109,8 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60806040526108ec806100136000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a",
|
||||
"bytecode": "0x6080806040526107fb90816100128239f3fe604060808152600436101561001357600080fd5b6000803560e01c9182631b57b72f1461003c5750506386575ee91461003757600080fd5b610362565b3461015e5761004a36610162565b61005e61005982949394610523565b6104df565b928184527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061008c83610523565b01855b81811061013e575050845b8281106100b6578351806100b2874380409084610238565b0390f35b806100cd6100c86101399386866105c7565b61060c565b87806100da8488886105c7565b92816100eb6020958681019061062d565b91906100fb8c518094819361067e565b03925af1906101086106c6565b9061011b6101146104ba565b9315158452565b8201526101288288610755565b526101338187610755565b50610769565b61009a565b6020906101496104ba565b8881528260608183015282890101520161008f565b5080fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101cd5760043567ffffffffffffffff928382116101cd57806023830112156101cd5781600401359384116101cd5760248460051b830101116101cd576024019190565b600080fd5b60005b8381106101e55750506000910152565b81810151838201526020016101d5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610231815180928187528780880191016101d2565b0116010190565b9160608301918352602090818401526040926060848201528451809352608081018260808560051b8401019601946000925b85841061027b575050505050505090565b9091929394959685806102ca837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80866001960301885286838d51805115158452015191818582015201906101f5565b99019401940192959493919061026a565b90604082019082526020604081840152835180925260608301928160608460051b8301019501936000915b8483106103165750505050505090565b9091929394958480610352837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086600196030187528a516101f5565b9801930193019194939290610306565b346101cd5761037036610162565b6103798161053b565b916000805b83811061039457604051806100b28743836102db565b6103a26100c88286866105c7565b82806103bc6103b28589896105c7565b602081019061062d565b82604095926103cf87518094819361067e565b03925af1906103dc6106c6565b918290156103fa575050906103f5916101288288610755565b61037e565b604483929351106104535761042061044f916004809401602480915183010191016106ec565b92519283927fb5e1dc2d0000000000000000000000000000000000000000000000000000000084528301610744565b0390fd5b82517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604490fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051906040820182811067ffffffffffffffff8211176104da57604052565b61048b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176104da57604052565b67ffffffffffffffff81116104da5760051b60200190565b9061054861005983610523565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06105768294610523565b019060005b82811061058757505050565b80606060208093850101520161057b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156106075760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1813603018212156101cd570190565b610598565b3573ffffffffffffffffffffffffffffffffffffffff811681036101cd5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101cd570180359067ffffffffffffffff82116101cd576020019181360383136101cd57565b908092918237016000815290565b67ffffffffffffffff81116104da57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156106e7573d906106da6100598361068c565b9182523d6000602084013e565b606090565b6020818303126101cd5780519067ffffffffffffffff82116101cd570181601f820112156101cd5780516107226100598261068c565b92818452602082840101116101cd5761074191602080850191016101d2565b90565b9060206107419281815201906101f5565b80518210156106075760209160051b010190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212206c86e7cf81738039d37cf5e545b323288faae992e0d08dec8c43f2f2b31f35f664736f6c63430008130033",
|
||||
"deployedBytecode": "0x604060808152600436101561001357600080fd5b6000803560e01c9182631b57b72f1461003c5750506386575ee91461003757600080fd5b610362565b3461015e5761004a36610162565b61005e61005982949394610523565b6104df565b928184527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061008c83610523565b01855b81811061013e575050845b8281106100b6578351806100b2874380409084610238565b0390f35b806100cd6100c86101399386866105c7565b61060c565b87806100da8488886105c7565b92816100eb6020958681019061062d565b91906100fb8c518094819361067e565b03925af1906101086106c6565b9061011b6101146104ba565b9315158452565b8201526101288288610755565b526101338187610755565b50610769565b61009a565b6020906101496104ba565b8881528260608183015282890101520161008f565b5080fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101cd5760043567ffffffffffffffff928382116101cd57806023830112156101cd5781600401359384116101cd5760248460051b830101116101cd576024019190565b600080fd5b60005b8381106101e55750506000910152565b81810151838201526020016101d5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610231815180928187528780880191016101d2565b0116010190565b9160608301918352602090818401526040926060848201528451809352608081018260808560051b8401019601946000925b85841061027b575050505050505090565b9091929394959685806102ca837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80866001960301885286838d51805115158452015191818582015201906101f5565b99019401940192959493919061026a565b90604082019082526020604081840152835180925260608301928160608460051b8301019501936000915b8483106103165750505050505090565b9091929394958480610352837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086600196030187528a516101f5565b9801930193019194939290610306565b346101cd5761037036610162565b6103798161053b565b916000805b83811061039457604051806100b28743836102db565b6103a26100c88286866105c7565b82806103bc6103b28589896105c7565b602081019061062d565b82604095926103cf87518094819361067e565b03925af1906103dc6106c6565b918290156103fa575050906103f5916101288288610755565b61037e565b604483929351106104535761042061044f916004809401602480915183010191016106ec565b92519283927fb5e1dc2d0000000000000000000000000000000000000000000000000000000084528301610744565b0390fd5b82517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604490fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051906040820182811067ffffffffffffffff8211176104da57604052565b61048b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176104da57604052565b67ffffffffffffffff81116104da5760051b60200190565b9061054861005983610523565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06105768294610523565b019060005b82811061058757505050565b80606060208093850101520161057b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156106075760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1813603018212156101cd570190565b610598565b3573ffffffffffffffffffffffffffffffffffffffff811681036101cd5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101cd570180359067ffffffffffffffff82116101cd576020019181360383136101cd57565b908092918237016000815290565b67ffffffffffffffff81116104da57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156106e7573d906106da6100598361068c565b9182523d6000602084013e565b606090565b6020818303126101cd5780519067ffffffffffffffff82116101cd570181601f820112156101cd5780516107226100598261068c565b92818452602082840101116101cd5761074191602080850191016101d2565b90565b9060206107419281815201906101f5565b80518210156106075760209160051b010190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212206c86e7cf81738039d37cf5e545b323288faae992e0d08dec8c43f2f2b31f35f664736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
@ -2,9 +2,25 @@
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "SafeTransferLib",
|
||||
"sourceName": "contracts/lib/utils/SafeTransferLib.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "ETHTransferFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TransferFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TransferFromFailed",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220007e83452e6dfca4997d94ba5608da3c2308815d3239b1810079c74651f15a7464736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220007e83452e6dfca4997d94ba5608da3c2308815d3239b1810079c74651f15a7464736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
"buildInfo": "../../build-info/48e41d4e5101419dba9d0e289a5fae78.json"
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,10 +1,9 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
import { Owned } from "./lib/auth/Owned.sol";
|
||||
|
||||
contract Reputation is IReputation, Owned(msg.sender) {
|
||||
contract Reputation is IReputation {
|
||||
/// @dev Asymptote numerator constant value for the `limiter` fx.
|
||||
uint256 public constant maxLimit = 1e6;
|
||||
/// @dev Denominator's constant operand for the `limiter` fx.
|
||||
|
110
contracts/core/BaseUtils.sol
Normal file
110
contracts/core/BaseUtils.sol
Normal file
@ -0,0 +1,110 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { OwnerSettings } from "./OwnerSettings.sol";
|
||||
import { ECDSA } from "../lib/utils/ECDSA.sol";
|
||||
import { MerkleProofLib as Merkle } from "../lib/utils/MerkleProofLib.sol";
|
||||
|
||||
abstract contract BaseUtils is OwnerSettings {
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev List of Pix transactions already signed.
|
||||
/// mapping(bytes32 => bool) public usedTransactions;
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// let value := sload(bytes32).
|
||||
|
||||
/// ███ Helper FX ██████████████████████████████████████████████████████████
|
||||
function _setUsedTransactions(bytes32 message) internal {
|
||||
assembly {
|
||||
sstore(message, true)
|
||||
}
|
||||
}
|
||||
|
||||
function usedTransactions(
|
||||
bytes32 message
|
||||
) public view returns (bool used) {
|
||||
assembly {
|
||||
used := sload(message)
|
||||
}
|
||||
}
|
||||
|
||||
function _signerCheck(
|
||||
bytes32 _message,
|
||||
bytes32 _r,
|
||||
bytes32 _s,
|
||||
uint8 _v
|
||||
) internal view {
|
||||
if (usedTransactions(_message))
|
||||
revert TxAlreadyUsed();
|
||||
|
||||
if (
|
||||
!validBacenSigners(
|
||||
_castAddrToKey(
|
||||
ECDSA.recover(
|
||||
ECDSA.toEthSignedMessageHash(
|
||||
_message
|
||||
),
|
||||
_v,
|
||||
_r,
|
||||
_s
|
||||
)
|
||||
)
|
||||
)
|
||||
) revert InvalidSigner();
|
||||
}
|
||||
|
||||
function _merkleVerify(
|
||||
bytes32[] calldata _merkleProof,
|
||||
bytes32 _root,
|
||||
address _addr
|
||||
) internal pure {
|
||||
if (
|
||||
!Merkle.verify(
|
||||
_merkleProof,
|
||||
_root,
|
||||
bytes32(uint256(uint160(_addr)))
|
||||
)
|
||||
) revert AddressDenied();
|
||||
}
|
||||
|
||||
function _castToUint(
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid
|
||||
)
|
||||
internal
|
||||
pure
|
||||
returns (
|
||||
uint256 _amountCasted,
|
||||
uint256 _pixTargetCasted,
|
||||
uint256 _validCasted
|
||||
)
|
||||
{
|
||||
assembly {
|
||||
_amountCasted := _amount
|
||||
_pixTargetCasted := _pixTarget
|
||||
_validCasted := _valid
|
||||
}
|
||||
}
|
||||
|
||||
/// @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;
|
||||
assembly {
|
||||
_key := shl(12, _addr)
|
||||
}
|
||||
}
|
||||
|
||||
function _castKeyToAddr(
|
||||
uint256 _key
|
||||
) public pure returns (address _addr) {
|
||||
// _addr = address(uint160(uint256(_key >> 12)));
|
||||
assembly {
|
||||
_addr := shr(12, _key)
|
||||
}
|
||||
}
|
||||
}
|
49
contracts/core/Constants.sol
Normal file
49
contracts/core/Constants.sol
Normal file
@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
abstract contract Constants {
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
uint256 constant _ROOT_UPDATED_EVENT_SIGNATURE =
|
||||
0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632;
|
||||
uint256 constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE =
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a;
|
||||
|
||||
/// @dev Seller casted to key => Seller's allowlist merkleroot.
|
||||
/// mapping(uint256 => bytes32) public sellerAllowList;
|
||||
uint256 constant _SELLER_ALLOWLIST_SLOT_SEED = 0x74dfee70;
|
||||
/// @dev Tokens allowed to serve as the underlying amount of a deposit.
|
||||
/// mapping(ERC20 => bool) public allowedERC20s;
|
||||
uint256 constant _ALLOWED_ERC20_SLOT_SEED = 0xcbc9d1c4;
|
||||
|
||||
/// @dev `balance` max. value = 10**26.
|
||||
/// @dev `pixTarget` keys are restricted to 160 bits.
|
||||
/// mapping(uint256 => mapping(ERC20 => uint256)) public sellerBalance;
|
||||
|
||||
/// @dev Bits layout:
|
||||
/// `uint96` [0...94] := balance
|
||||
/// `uint160` [95...254] := pixTarget
|
||||
/// `bool` [255] := valid
|
||||
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// mstore(0x20, token)
|
||||
/// mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
/// mstore(0x00, seller)
|
||||
/// let value := sload(keccak256(0x0c, 0x34)).
|
||||
uint256 constant _SELLER_BALANCE_SLOT_SEED = 0x739094b1;
|
||||
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 constant BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
/// @dev The bit position of `pixTarget` in `sellerBalance`.
|
||||
uint256 constant BITPOS_PIXTARGET = 95;
|
||||
/// @dev The bit position of `valid` in `sellerBalance`.
|
||||
uint256 constant BITPOS_VALID = 255;
|
||||
/// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one.
|
||||
uint256 constant BITMASK_VALID = (1 << 255) - 1;
|
||||
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 constant WAD = 1e18;
|
||||
uint256 constant MAXBALANCE_UPPERBOUND = 1e8 ether;
|
||||
uint256 constant REPUTATION_LOWERBOUND = 1e2 ether;
|
||||
uint256 constant LOCKAMOUNT_UPPERBOUND = 1e6 ether;
|
||||
}
|
@ -1,25 +1,26 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "../lib/tokens/ERC20.sol";
|
||||
|
||||
library DataTypes {
|
||||
struct Lock {
|
||||
uint256 sellerKey;
|
||||
uint256 counter;
|
||||
/// @dev Amount to be paid for relayer.
|
||||
uint256 relayerPremium;
|
||||
/// @dev Amount to be tranfered via PIX.
|
||||
uint256 amount;
|
||||
/// @dev If not paid at this block will be expired.
|
||||
uint256 expirationBlock;
|
||||
uint160 pixTarget;
|
||||
/// @dev Amount to be paid for relayer.
|
||||
uint80 relayerPremium;
|
||||
/// @dev Where the tokens are sent the when order gets validated.
|
||||
/// @dev Amount to be tranfered via PIX.
|
||||
uint80 amount;
|
||||
address buyerAddress;
|
||||
/// @dev Relayer's target address that receives `relayerPremium` funds.
|
||||
address relayerTarget;
|
||||
/// @dev Relayer address (msg.sender) that facilitated this transaction.
|
||||
/// @dev Relayer's target address that receives `relayerPremium` funds.
|
||||
/// @dev Reputation points accruer.
|
||||
address relayerAddress;
|
||||
address token;
|
||||
ERC20 token;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
@ -1,62 +1,73 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "../lib/tokens/ERC20.sol";
|
||||
|
||||
// prettier-ignore
|
||||
interface EventAndErrors {
|
||||
/// ███ Events ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev 0x63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf
|
||||
event DepositAdded(
|
||||
address indexed seller,
|
||||
// uint256 depositID,
|
||||
address token,
|
||||
ERC20 token,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0xca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d49
|
||||
event ValidSet(
|
||||
address indexed seller,
|
||||
address token,
|
||||
ERC20 token,
|
||||
bool state
|
||||
);
|
||||
/// @dev 0x2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e
|
||||
event DepositWithdrawn(
|
||||
address indexed seller,
|
||||
address token,
|
||||
ERC20 token,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65
|
||||
event LockAdded(
|
||||
address indexed buyer,
|
||||
uint256 indexed lockID,
|
||||
uint256 seller,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8
|
||||
event LockReleased(
|
||||
address indexed buyer,
|
||||
uint256 lockId,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da5
|
||||
event LockReturned(
|
||||
address indexed buyer,
|
||||
uint256 lockId
|
||||
);
|
||||
/// @dev 0xeaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d
|
||||
event FundsWithdrawn(
|
||||
address owner,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632
|
||||
event RootUpdated(
|
||||
address seller,
|
||||
bytes32 merkleRoot
|
||||
address indexed seller,
|
||||
bytes32 indexed merkleRoot
|
||||
);
|
||||
/// @dev 0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a
|
||||
event AllowedERC20Updated(
|
||||
address indexed token,
|
||||
bool indexed state
|
||||
);
|
||||
/// @dev 0xe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f
|
||||
event ReputationUpdated(address reputation);
|
||||
/// @dev 0x70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511
|
||||
event LockBlocksUpdated(uint256 blocks);
|
||||
/// @dev 0x14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7
|
||||
event ValidSignersUpdated(address[] signers);
|
||||
|
||||
/// ███ Errors ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev Deposit already exist and it is still valid.
|
||||
/// @dev 0xc44bd765
|
||||
error DepositAlreadyExists();
|
||||
/// @dev Only seller could call this function.
|
||||
/// @dev `msg.sender` and the seller differ.
|
||||
/// @dev 0x85d1f726
|
||||
@ -105,7 +116,6 @@ interface EventAndErrors {
|
||||
/// @dev Reverts on an expired lock.
|
||||
/// @dev 0xf6fafba0
|
||||
error LockExpired();
|
||||
|
||||
/// @dev 0xce3a3d37
|
||||
error DecOverflow();
|
||||
/// @dev 0xf3fb0eb9
|
197
contracts/core/OwnerSettings.sol
Normal file
197
contracts/core/OwnerSettings.sol
Normal file
@ -0,0 +1,197 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20, SafeTransferLib } from "../lib/utils/SafeTransferLib.sol";
|
||||
import { IReputation } from "../lib/interfaces/IReputation.sol";
|
||||
import { EventAndErrors } from "./EventAndErrors.sol";
|
||||
import { Constants } from "./Constants.sol";
|
||||
import { Owned } from "../lib/auth/Owned.sol";
|
||||
|
||||
abstract contract OwnerSettings is
|
||||
Constants,
|
||||
EventAndErrors,
|
||||
Owned(msg.sender)
|
||||
{
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev List of valid Bacen signature addresses
|
||||
/// mapping(uint256 => bool) public validBacenSigners;
|
||||
/// @dev Value in custom storage slot given by:
|
||||
/// let value := sload(shl(12, address)).
|
||||
|
||||
IReputation public reputation;
|
||||
/// @dev Default blocks that lock will hold tokens.
|
||||
uint256 public defaultLockBlocks;
|
||||
|
||||
/// ███ Constructor ████████████████████████████████████████████████████████
|
||||
|
||||
constructor(
|
||||
uint256 defaultBlocks,
|
||||
address[] memory validSigners,
|
||||
address _reputation,
|
||||
ERC20[] memory tokens,
|
||||
bool[] memory tokenStates
|
||||
) {
|
||||
setDefaultLockBlocks(defaultBlocks);
|
||||
setValidSigners(validSigners);
|
||||
setReputation(IReputation(_reputation));
|
||||
tokenSettings(tokens, tokenStates);
|
||||
}
|
||||
|
||||
/// ███ Owner Only █████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev Contract's underlying balance withdraw method.
|
||||
/// @dev Function sighash: 0x5fd8c710.
|
||||
function withdrawBalance() external onlyOwner {
|
||||
uint256 balance = address(this).balance;
|
||||
SafeTransferLib.safeTransferETH(msg.sender, balance);
|
||||
emit FundsWithdrawn(msg.sender, balance);
|
||||
}
|
||||
|
||||
function setReputation(
|
||||
IReputation _reputation
|
||||
) public onlyOwner {
|
||||
assembly {
|
||||
sstore(reputation.slot, _reputation)
|
||||
}
|
||||
emit ReputationUpdated(address(_reputation));
|
||||
}
|
||||
|
||||
function setDefaultLockBlocks(
|
||||
uint256 _blocks
|
||||
) public onlyOwner {
|
||||
assembly {
|
||||
sstore(defaultLockBlocks.slot, _blocks)
|
||||
}
|
||||
emit LockBlocksUpdated(_blocks);
|
||||
}
|
||||
|
||||
function setValidSigners(
|
||||
address[] memory _validSigners
|
||||
) public onlyOwner {
|
||||
assembly {
|
||||
let i := add(_validSigners, 0x20)
|
||||
let end := add(i, shl(0x05, mload(_validSigners)))
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
sstore(shl(12, mload(i)), true)
|
||||
i := add(i, 0x20)
|
||||
|
||||
if iszero(lt(i, end)) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
emit ValidSignersUpdated(_validSigners);
|
||||
}
|
||||
|
||||
function tokenSettings(
|
||||
ERC20[] memory _tokens,
|
||||
bool[] memory _states
|
||||
) public onlyOwner {
|
||||
/* Yul Impl */
|
||||
assembly {
|
||||
// first 32 bytes eq to array's length
|
||||
let tLen := mload(_tokens)
|
||||
// NoTokens()
|
||||
if iszero(tLen) {
|
||||
mstore(0x00, 0xdf957883)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// LengthMismatch()
|
||||
if iszero(eq(tLen, mload(_states))) {
|
||||
mstore(0x00, 0xff633a38)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
let tLoc := add(_tokens, 0x20)
|
||||
let sLoc := add(_states, 0x20)
|
||||
for {
|
||||
let end := add(tLoc, shl(5, tLen))
|
||||
} iszero(eq(tLoc, end)) {
|
||||
tLoc := add(tLoc, 0x20)
|
||||
sLoc := add(sLoc, 0x20)
|
||||
} {
|
||||
// cache hashmap entry in scratch space
|
||||
mstore(0x0c, _ALLOWED_ERC20_SLOT_SEED)
|
||||
mstore(0x00, mload(tLoc))
|
||||
// let mapSlot := keccak256(0x0c, 0x20)
|
||||
sstore(keccak256(0x0c, 0x20), mload(sLoc))
|
||||
|
||||
// emit AllowedERC20Updated(address, bool)
|
||||
log3(
|
||||
0,
|
||||
0,
|
||||
_ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE,
|
||||
mload(tLoc),
|
||||
mload(sLoc)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ███ View FX ████████████████████████████████████████████████████████████
|
||||
|
||||
function validBacenSigners(
|
||||
uint256 signer
|
||||
) public view returns (bool valid) {
|
||||
assembly {
|
||||
valid := sload(signer)
|
||||
}
|
||||
}
|
||||
|
||||
function sellerAllowList(
|
||||
uint256 sellerKey
|
||||
) public view returns (bytes32 root) {
|
||||
assembly {
|
||||
mstore(0x0c, _SELLER_ALLOWLIST_SLOT_SEED)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
root := sload(keccak256(0x00, 0x20))
|
||||
}
|
||||
}
|
||||
|
||||
function allowedERC20s(
|
||||
ERC20 erc20
|
||||
) public view returns (bool state) {
|
||||
assembly {
|
||||
mstore(0x0c, _ALLOWED_ERC20_SLOT_SEED)
|
||||
mstore(0x00, erc20)
|
||||
state := sload(keccak256(0x0c, 0x20))
|
||||
}
|
||||
}
|
||||
|
||||
function _limiter(
|
||||
uint256 _userCredit
|
||||
) internal view returns (uint256 _spendLimit) {
|
||||
bytes memory encodedParams = abi.encodeWithSelector(
|
||||
// IReputation.limiter.selector,
|
||||
0x4d2b1791,
|
||||
_userCredit
|
||||
);
|
||||
bool success;
|
||||
assembly {
|
||||
success := staticcall(
|
||||
// gas
|
||||
0x7530,
|
||||
// address
|
||||
sload(reputation.slot),
|
||||
// argsOffset
|
||||
add(encodedParams, 0x20),
|
||||
// argsSize
|
||||
mload(encodedParams),
|
||||
// retOffset
|
||||
0x00,
|
||||
// retSize
|
||||
0x20
|
||||
)
|
||||
_spendLimit := mload(0x00)
|
||||
if iszero(success) {
|
||||
// StaticCallFailed()
|
||||
mstore(0x00, 0xe10bf1cc)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@ pragma solidity >=0.8.4;
|
||||
/// @notice Simple single owner authorization mixin.
|
||||
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Owned.sol)
|
||||
abstract contract Owned {
|
||||
error Unauthorized();
|
||||
|
||||
/*//////////////////////////////////////////////////////////////
|
||||
EVENTS
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
@ -20,7 +22,7 @@ abstract contract Owned {
|
||||
address public owner;
|
||||
|
||||
modifier onlyOwner() virtual {
|
||||
require(msg.sender == owner, "UNAUTHORIZED");
|
||||
if (msg.sender != owner) revert Unauthorized();
|
||||
|
||||
_;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "../tokens/ERC20.sol";
|
||||
|
||||
|
78
contracts/lib/utils/ECDSA.sol
Normal file
78
contracts/lib/utils/ECDSA.sol
Normal file
@ -0,0 +1,78 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.8.4;
|
||||
|
||||
/// @notice Gas optimized ECDSA wrapper.
|
||||
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)
|
||||
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)
|
||||
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)
|
||||
library ECDSA {
|
||||
/// @dev The signature is invalid.
|
||||
error InvalidSignature();
|
||||
|
||||
/// @dev The number which `s` must not exceed in order for
|
||||
/// the signature to be non-malleable.
|
||||
bytes32 private constant _MALLEABILITY_THRESHOLD =
|
||||
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0;
|
||||
|
||||
/// @dev Recovers the signer's address from a message digest `hash`,
|
||||
/// and the signature defined by `v`, `r`, `s`.
|
||||
function recover(
|
||||
bytes32 hash,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) internal view returns (address result) {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Copy the free memory pointer so that we can restore it later.
|
||||
let m := mload(0x40)
|
||||
mstore(0x00, hash)
|
||||
mstore(0x20, and(v, 0xff))
|
||||
mstore(0x40, r)
|
||||
mstore(0x60, s)
|
||||
pop(
|
||||
staticcall(
|
||||
gas(), // Amount of gas left for the transaction.
|
||||
// If `s` in lower half order, such that the signature is not malleable.
|
||||
lt(s, add(_MALLEABILITY_THRESHOLD, 1)), // Address of `ecrecover`.
|
||||
0x00, // Start of input.
|
||||
0x80, // Size of input.
|
||||
0x00, // Start of output.
|
||||
0x20 // Size of output.
|
||||
)
|
||||
)
|
||||
result := mload(0x00)
|
||||
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
|
||||
if iszero(returndatasize()) {
|
||||
// Store the function selector of `InvalidSignature()`.
|
||||
mstore(0x00, 0x8baa579f)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// Restore the zero slot.
|
||||
mstore(0x60, 0)
|
||||
// Restore the free memory pointer.
|
||||
mstore(0x40, m)
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Returns an Ethereum Signed Message, created from a `hash`.
|
||||
/// This produces a hash corresponding to the one signed with the
|
||||
/// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
|
||||
/// JSON-RPC method as part of EIP-191.
|
||||
function toEthSignedMessageHash(
|
||||
bytes32 hash
|
||||
) internal pure returns (bytes32 result) {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Store into scratch space for keccak256.
|
||||
mstore(0x20, hash)
|
||||
mstore(
|
||||
0x00,
|
||||
"\x00\x00\x00\x00\x19Ethereum Signed Message:\n32"
|
||||
)
|
||||
// 0x40 - 0x04 = 0x3c
|
||||
result := keccak256(0x04, 0x3c)
|
||||
}
|
||||
}
|
||||
}
|
@ -4,114 +4,140 @@ pragma solidity >=0.8.4;
|
||||
import { ERC20 } from "../tokens/ERC20.sol";
|
||||
|
||||
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
|
||||
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
|
||||
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
|
||||
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
|
||||
/// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller.
|
||||
library SafeTransferLib {
|
||||
/*//////////////////////////////////////////////////////////////
|
||||
CUSTOM ERRORS
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
|
||||
/// @dev The ETH transfer has failed.
|
||||
error ETHTransferFailed();
|
||||
/// @dev The ERC20 `transferFrom` has failed.
|
||||
error TransferFromFailed();
|
||||
/// @dev The ERC20 `transfer` has failed.
|
||||
error TransferFailed();
|
||||
|
||||
/*//////////////////////////////////////////////////////////////
|
||||
ETH OPERATIONS
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
|
||||
/// @dev Sends `amount` (in wei) ETH to `to`.
|
||||
/// Reverts upon failure.
|
||||
function safeTransferETH(
|
||||
address to,
|
||||
uint256 amount
|
||||
) internal {
|
||||
bool success;
|
||||
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Transfer the ETH and store if it succeeded or not.
|
||||
success := call(gas(), to, amount, 0, 0, 0, 0)
|
||||
// Transfer the ETH and check if it succeeded or not.
|
||||
if iszero(call(gas(), to, amount, 0, 0, 0, 0)) {
|
||||
// Store the function selector of `ETHTransferFailed()`.
|
||||
mstore(0x00, 0xb12d13eb)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
}
|
||||
|
||||
require(success, "ETH_TRANSFER_FAILED");
|
||||
}
|
||||
|
||||
/*//////////////////////////////////////////////////////////////
|
||||
ERC20 OPERATIONS
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
|
||||
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
|
||||
/// Reverts upon failure.
|
||||
///
|
||||
/// The `from` account must have at least `amount` approved for
|
||||
/// the current contract to manage.
|
||||
function safeTransferFrom(
|
||||
ERC20 token,
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount
|
||||
) internal {
|
||||
bool success;
|
||||
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// We'll write our calldata to this slot below, but restore it later.
|
||||
let memPointer := mload(0x40)
|
||||
let m := mload(0x40) // Cache the free memory pointer.
|
||||
|
||||
// Write the abi-encoded calldata into memory, beginning with the function selector.
|
||||
mstore(
|
||||
0,
|
||||
0x23b872dd00000000000000000000000000000000000000000000000000000000
|
||||
)
|
||||
mstore(4, from) // Append the "from" argument.
|
||||
mstore(36, to) // Append the "to" argument.
|
||||
mstore(68, amount) // Append the "amount" argument.
|
||||
mstore(0x60, amount) // Store the `amount` argument.
|
||||
mstore(0x40, to) // Store the `to` argument.
|
||||
mstore(0x2c, shl(96, from)) // Store the `from` argument.
|
||||
// Store the function selector of `transferFrom(address,address,uint256)`.
|
||||
mstore(0x0c, 0x23b872dd000000000000000000000000)
|
||||
|
||||
success := and(
|
||||
if iszero(
|
||||
and(
|
||||
// The arguments of `and` are evaluated from right to left.
|
||||
// Set success to whether the call reverted, if not we check it either
|
||||
// returned exactly 1 (can't just be non-zero data), or had no return data.
|
||||
or(
|
||||
and(
|
||||
eq(mload(0), 1),
|
||||
gt(returndatasize(), 31)
|
||||
),
|
||||
eq(mload(0x00), 1),
|
||||
iszero(returndatasize())
|
||||
),
|
||||
// We use 100 because that's the total length of our calldata (4 + 32 * 3)
|
||||
// Counterintuitively, this call() must be positioned after the or() in the
|
||||
// surrounding and() because and() evaluates its arguments from right to left.
|
||||
call(gas(), token, 0, 0, 100, 0, 32)
|
||||
call(
|
||||
gas(),
|
||||
token,
|
||||
0,
|
||||
0x1c,
|
||||
0x64,
|
||||
0x00,
|
||||
0x20
|
||||
)
|
||||
)
|
||||
) {
|
||||
// Store the function selector of `TransferFromFailed()`.
|
||||
mstore(0x00, 0x7939f424)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
|
||||
mstore(0x60, 0) // Restore the zero slot to zero.
|
||||
mstore(0x40, memPointer) // Restore the memPointer.
|
||||
}
|
||||
|
||||
require(success, "TRANSFER_FROM_FAILED");
|
||||
mstore(0x40, m) // Restore the free memory pointer.
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
|
||||
/// Reverts upon failure.
|
||||
function safeTransfer(
|
||||
ERC20 token,
|
||||
address to,
|
||||
uint256 amount
|
||||
) internal {
|
||||
bool success;
|
||||
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// We'll write our calldata to this slot below, but restore it later.
|
||||
let memPointer := mload(0x40)
|
||||
mstore(0x14, to) // Store the `to` argument.
|
||||
mstore(0x34, amount) // Store the `amount` argument.
|
||||
// Store the function selector of `transfer(address,uint256)`.
|
||||
mstore(0x00, 0xa9059cbb000000000000000000000000)
|
||||
|
||||
// Write the abi-encoded calldata into memory, beginning with the function selector.
|
||||
mstore(
|
||||
0,
|
||||
0xa9059cbb00000000000000000000000000000000000000000000000000000000
|
||||
)
|
||||
mstore(4, to) // Append the "to" argument.
|
||||
mstore(36, amount) // Append the "amount" argument.
|
||||
|
||||
success := and(
|
||||
if iszero(
|
||||
and(
|
||||
// The arguments of `and` are evaluated from right to left.
|
||||
// Set success to whether the call reverted, if not we check it either
|
||||
// returned exactly 1 (can't just be non-zero data), or had no return data.
|
||||
or(
|
||||
and(
|
||||
eq(mload(0), 1),
|
||||
gt(returndatasize(), 31)
|
||||
),
|
||||
eq(mload(0x00), 1),
|
||||
iszero(returndatasize())
|
||||
),
|
||||
// We use 68 because that's the total length of our calldata (4 + 32 * 2)
|
||||
// Counterintuitively, this call() must be positioned after the or() in the
|
||||
// surrounding and() because and() evaluates its arguments from right to left.
|
||||
call(gas(), token, 0, 0, 68, 0, 32)
|
||||
call(
|
||||
gas(),
|
||||
token,
|
||||
0,
|
||||
0x10,
|
||||
0x44,
|
||||
0x00,
|
||||
0x20
|
||||
)
|
||||
|
||||
mstore(0x60, 0) // Restore the zero slot to zero.
|
||||
mstore(0x40, memPointer) // Restore the memPointer.
|
||||
)
|
||||
) {
|
||||
// Store the function selector of `TransferFailed()`.
|
||||
mstore(0x00, 0x90b8ec18)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// Restore the part of the free memory pointer that was overwritten.
|
||||
mstore(0x34, 0)
|
||||
}
|
||||
|
||||
require(success, "TRANSFER_FAILED");
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
/// ______ __
|
||||
/// .-----.|__ |.-----.|__|.--.--.
|
||||
@ -8,19 +8,14 @@ pragma solidity 0.8.9;
|
||||
/// |__| |__|
|
||||
///
|
||||
|
||||
import { Owned } from "./lib/auth/Owned.sol";
|
||||
import { ERC20, SafeTransferLib } from "./lib/utils/SafeTransferLib.sol";
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
import { MerkleProofLib as Merkle } from "./lib/utils/MerkleProofLib.sol";
|
||||
import { ReentrancyGuard } from "./lib/utils/ReentrancyGuard.sol";
|
||||
import { EventAndErrors } from "./EventAndErrors.sol";
|
||||
import { DataTypes as DT } from "./DataTypes.sol";
|
||||
|
||||
contract P2PIX is
|
||||
EventAndErrors,
|
||||
Owned(msg.sender),
|
||||
ReentrancyGuard
|
||||
{
|
||||
import { OwnerSettings, ERC20, SafeTransferLib } from "./core/OwnerSettings.sol";
|
||||
import { BaseUtils } from "./core/BaseUtils.sol";
|
||||
import { ReentrancyGuard } from "./lib/utils/ReentrancyGuard.sol";
|
||||
import { DataTypes as DT } from "./core/DataTypes.sol";
|
||||
|
||||
|
||||
contract P2PIX is BaseUtils, ReentrancyGuard {
|
||||
// solhint-disable use-forbidden-name
|
||||
// solhint-disable no-inline-assembly
|
||||
// solhint-disable no-empty-blocks
|
||||
@ -28,64 +23,32 @@ contract P2PIX is
|
||||
using DT for DT.Lock;
|
||||
using DT for DT.LockStatus;
|
||||
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 private constant BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
/// @dev The bit position of `pixTarget` in `sellerBalance`.
|
||||
uint256 private constant BITPOS_PIXTARGET = 95;
|
||||
/// @dev The bit position of `valid` in `sellerBalance`.
|
||||
uint256 private constant BITPOS_VALID = 255;
|
||||
/// @dev The bitmask of all 256 bits of `sellerBalance` except for the last one.
|
||||
uint256 private constant BITMASK_VALID = (1 << 255) - 1;
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 public constant WAD = 1e18;
|
||||
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
IReputation public reputation;
|
||||
|
||||
/// @dev Default blocks that lock will hold tokens.
|
||||
uint256 public defaultLockBlocks;
|
||||
uint256 public lockCounter;
|
||||
|
||||
/// @dev List of Locks.
|
||||
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.
|
||||
mapping(uint256 => uint256) public userRecord;
|
||||
/// @dev List of valid Bacen signature addresses
|
||||
mapping(uint256 => bool) public validBacenSigners;
|
||||
/// @dev List of Pix transactions already signed.
|
||||
mapping(bytes32 => bool) public usedTransactions;
|
||||
/// @dev Tokens allowed to serve as the underlying amount of a deposit.
|
||||
mapping(ERC20 => bool) public allowedERC20s;
|
||||
|
||||
// BITS LAYOUT
|
||||
// `uint96` [0...94] := balance
|
||||
// `uint160` [95...254] := pixTarget
|
||||
// `bool` [255] := valid
|
||||
|
||||
/// @dev `balance` max. value = 10**26.
|
||||
/// @dev `pixTarget` keys are restricted to 160 bits.
|
||||
mapping(uint256 => mapping(ERC20 => uint256))
|
||||
public sellerBalance;
|
||||
|
||||
/// ███ Constructor ████████████████████████████████████████████████████████
|
||||
|
||||
constructor(
|
||||
uint256 defaultBlocks,
|
||||
address[] memory validSigners,
|
||||
IReputation _reputation,
|
||||
address[] memory tokens,
|
||||
address _reputation,
|
||||
ERC20[] memory tokens,
|
||||
bool[] memory tokenStates
|
||||
) payable {
|
||||
setDefaultLockBlocks(defaultBlocks);
|
||||
setReputation(_reputation);
|
||||
setValidSigners(validSigners);
|
||||
tokenSettings(tokens, tokenStates);
|
||||
}
|
||||
)
|
||||
OwnerSettings(
|
||||
defaultBlocks,
|
||||
validSigners,
|
||||
_reputation,
|
||||
tokens,
|
||||
tokenStates
|
||||
)
|
||||
payable {/* */}
|
||||
|
||||
/// ███ Public FX ██████████████████████████████████████████████████████████
|
||||
|
||||
@ -97,7 +60,7 @@ contract P2PIX is
|
||||
/// as the deposit identifier.
|
||||
/// @dev Function sighash: 0xbfe07da6.
|
||||
function deposit(
|
||||
address _token,
|
||||
ERC20 _token,
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid,
|
||||
@ -107,11 +70,11 @@ contract P2PIX is
|
||||
uint256 k = _castAddrToKey(msg.sender);
|
||||
|
||||
if (_pixTarget == 0) revert EmptyPixTarget();
|
||||
if (!allowedERC20s[t]) revert TokenDenied();
|
||||
uint256 _sellerBalance = sellerBalance[k][t];
|
||||
if (!allowedERC20s(t)) revert TokenDenied();
|
||||
uint256 _sellerBalance = sellerBalance(k,t);
|
||||
|
||||
uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY;
|
||||
if ((currBal + _amount) > 1e8 ether)
|
||||
if ((currBal + _amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
setReentrancyGuard();
|
||||
@ -129,10 +92,13 @@ contract P2PIX is
|
||||
validCasted
|
||||
) = _castToUint(_amount, _pixTarget, _valid);
|
||||
|
||||
sellerBalance[k][t] =
|
||||
(currBal + amountCasted) |
|
||||
_setSellerBalance(
|
||||
k,
|
||||
t,
|
||||
((currBal + amountCasted) |
|
||||
(pixTargetCasted << BITPOS_PIXTARGET) |
|
||||
(validCasted << BITPOS_VALID);
|
||||
(validCasted << BITPOS_VALID))
|
||||
);
|
||||
|
||||
SafeTransferLib.safeTransferFrom(
|
||||
t,
|
||||
@ -152,7 +118,7 @@ contract P2PIX is
|
||||
/// @dev Function sighash: 0x72fada5c.
|
||||
function setValidState(ERC20 token, bool state) public {
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
uint256 _sellerBalance = sellerBalance[key][token];
|
||||
uint256 _sellerBalance = sellerBalance(key, token);
|
||||
|
||||
if (_sellerBalance != 0) {
|
||||
uint256 _valid;
|
||||
@ -164,9 +130,9 @@ contract P2PIX is
|
||||
(_sellerBalance & BITMASK_VALID) |
|
||||
(_valid << BITPOS_VALID);
|
||||
|
||||
sellerBalance[key][token] = _sellerBalance;
|
||||
_setSellerBalance(key, token, _sellerBalance);
|
||||
|
||||
emit ValidSet(msg.sender, address(token), state);
|
||||
emit ValidSet(msg.sender, token, state);
|
||||
} else revert NotInitialized();
|
||||
}
|
||||
|
||||
@ -179,7 +145,6 @@ contract P2PIX is
|
||||
/// from the total `remaining` value.
|
||||
/// @dev Locks can only be performed in valid orders.
|
||||
/// @param _buyerAddress The address of the buyer of a `_depositID`.
|
||||
/// @param _relayerTarget Target address entitled to the `relayerPremium`.
|
||||
/// @param _relayerPremium The refund/premium owed to a relayer.
|
||||
/// @param _amount The deposit's remaining amount wished to be locked.
|
||||
/// @param merkleProof This value should be:
|
||||
@ -191,17 +156,16 @@ contract P2PIX is
|
||||
/// @dev Function sighash: 0x03aaf306.
|
||||
function lock(
|
||||
address _seller,
|
||||
address _token,
|
||||
ERC20 _token,
|
||||
address _buyerAddress,
|
||||
address _relayerTarget,
|
||||
uint256 _relayerPremium,
|
||||
uint256 _amount,
|
||||
uint80 _relayerPremium,
|
||||
uint80 _amount,
|
||||
bytes32[] calldata merkleProof,
|
||||
uint256[] calldata expiredLocks
|
||||
) public nonReentrant returns (uint256) {
|
||||
) public nonReentrant returns (uint256 lockID) {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
ERC20 t = ERC20(_token);
|
||||
ERC20 t = _token;
|
||||
if (!getValid(_seller, t)) revert InvalidDeposit();
|
||||
|
||||
uint256 bal = getBalance(_seller, t);
|
||||
@ -215,61 +179,31 @@ contract P2PIX is
|
||||
mapLocks[cCounter].expirationBlock >= block.number
|
||||
) revert NotExpired();
|
||||
|
||||
if (merkleProof.length != 0) {
|
||||
_merkleVerify( merkleProof, sellerAllowList(k), msg.sender);
|
||||
|
||||
} else if (_amount > REPUTATION_LOWERBOUND) {
|
||||
|
||||
uint256 userCredit = userRecord[_castAddrToKey(msg.sender)];
|
||||
uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD);
|
||||
if (
|
||||
_amount > (spendLimit * WAD) || _amount > LOCKAMOUNT_UPPERBOUND
|
||||
) revert AmountNotAllowed();
|
||||
}
|
||||
|
||||
DT.Lock memory l = DT.Lock(
|
||||
k,
|
||||
cCounter,
|
||||
(block.number + defaultLockBlocks),
|
||||
uint160(sellerBalance(k, t) >> BITPOS_PIXTARGET),
|
||||
_relayerPremium,
|
||||
_amount,
|
||||
(block.number + defaultLockBlocks),
|
||||
uint160(sellerBalance[k][t] >> BITPOS_PIXTARGET),
|
||||
_buyerAddress,
|
||||
_relayerTarget,
|
||||
msg.sender,
|
||||
address(t)
|
||||
t
|
||||
);
|
||||
|
||||
if (merkleProof.length != 0) {
|
||||
merkleVerify(
|
||||
merkleProof,
|
||||
sellerAllowList[k],
|
||||
msg.sender
|
||||
);
|
||||
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
} else {
|
||||
if (l.amount <= 1e2 ether) {
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
} else {
|
||||
uint256 userCredit = userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
];
|
||||
|
||||
uint256 spendLimit;
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
|
||||
if (
|
||||
l.amount > (spendLimit * WAD) ||
|
||||
l.amount > 1e6 ether
|
||||
) revert AmountNotAllowed();
|
||||
|
||||
_addLock(bal, _amount, cCounter, l, t, k);
|
||||
|
||||
lockCounter++;
|
||||
|
||||
// Halt execution and output `lockID`.
|
||||
return cCounter;
|
||||
}
|
||||
}
|
||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||
}
|
||||
|
||||
/// @notice Lock release method that liquidate lock
|
||||
@ -277,17 +211,15 @@ contract P2PIX is
|
||||
/// @dev This method can be called by any public actor
|
||||
/// as long the signature provided is valid.
|
||||
/// @dev `relayerPremium` gets splitted equaly
|
||||
/// if `relayerTarget` addresses differ.
|
||||
/// if relayer addresses differ.
|
||||
/// @dev If the `msg.sender` of this method and `l.relayerAddress` are the same,
|
||||
/// `msg.sender` accrues both l.amount and l.relayerPremium as userRecord credit.
|
||||
/// In case of they differing:
|
||||
/// - `lock` caller gets accrued with `l.amount` as userRecord credit;
|
||||
/// - `release` caller gets accrued with `l.relayerPremium` as userRecord credit;
|
||||
/// @param _relayerTarget Target address entitled to the `relayerPremium`.
|
||||
/// @dev Function sighash: 0x4e1389ed.
|
||||
function release(
|
||||
uint256 lockID,
|
||||
address _relayerTarget,
|
||||
bytes32 pixTimestamp,
|
||||
bytes32 r,
|
||||
bytes32 s,
|
||||
@ -306,22 +238,8 @@ contract P2PIX is
|
||||
pixTimestamp
|
||||
)
|
||||
);
|
||||
bytes32 messageDigest = keccak256(
|
||||
abi.encodePacked(
|
||||
"\x19Ethereum Signed Message:\n32",
|
||||
message
|
||||
)
|
||||
);
|
||||
|
||||
if (usedTransactions[message] == true)
|
||||
revert TxAlreadyUsed();
|
||||
|
||||
uint256 signer = _castAddrToKey(
|
||||
ecrecover(messageDigest, v, r, s)
|
||||
);
|
||||
|
||||
if (!validBacenSigners[signer])
|
||||
revert InvalidSigner();
|
||||
_signerCheck(message, r, s, v);
|
||||
|
||||
ERC20 t = ERC20(l.token);
|
||||
|
||||
@ -331,7 +249,7 @@ contract P2PIX is
|
||||
|
||||
l.amount = 0;
|
||||
l.expirationBlock = 0;
|
||||
usedTransactions[message] = true;
|
||||
_setUsedTransactions(message);
|
||||
|
||||
if (msg.sender != l.relayerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += l
|
||||
@ -352,21 +270,21 @@ contract P2PIX is
|
||||
|
||||
// Method doesn't check for zero address.
|
||||
if (l.relayerPremium != 0) {
|
||||
if (_relayerTarget != l.relayerTarget) {
|
||||
if (msg.sender != l.relayerAddress) {
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
l.relayerTarget,
|
||||
l.relayerAddress,
|
||||
(l.relayerPremium >> 1)
|
||||
);
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
_relayerTarget,
|
||||
msg.sender,
|
||||
(l.relayerPremium >> 1)
|
||||
);
|
||||
} else {
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
_relayerTarget,
|
||||
msg.sender,
|
||||
l.relayerPremium
|
||||
);
|
||||
}
|
||||
@ -392,15 +310,12 @@ contract P2PIX is
|
||||
|
||||
_notExpired(l);
|
||||
|
||||
uint256 _sellerBalance = sellerBalance[
|
||||
l.sellerKey
|
||||
][ERC20(l.token)] & BITMASK_SB_ENTRY;
|
||||
uint256 _sellerBalance = sellerBalance(l.sellerKey, l.token) & BITMASK_SB_ENTRY;
|
||||
|
||||
if ((_sellerBalance + l.amount) > 1e8 ether)
|
||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
sellerBalance[l.sellerKey][ERC20(l.token)] += l
|
||||
.amount;
|
||||
_addSellerBalance(l.sellerKey, l.token, l.amount);
|
||||
|
||||
l.amount = 0;
|
||||
|
||||
@ -410,8 +325,8 @@ contract P2PIX is
|
||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||
1);
|
||||
|
||||
if (_newUserRecord <= 1e2 ether) {
|
||||
userRecord[userKey] = 1e2 ether;
|
||||
if (_newUserRecord <= REPUTATION_LOWERBOUND) {
|
||||
userRecord[userKey] = REPUTATION_LOWERBOUND;
|
||||
} else {
|
||||
userRecord[userKey] = _newUserRecord;
|
||||
}
|
||||
@ -442,13 +357,12 @@ contract P2PIX is
|
||||
) public nonReentrant {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
if (getValid(msg.sender, token) == true) {
|
||||
if (getValid(msg.sender, token))
|
||||
setValidState(token, false);
|
||||
}
|
||||
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
_decBal(
|
||||
(sellerBalance[key][token] & BITMASK_SB_ENTRY),
|
||||
(sellerBalance(key, token) & BITMASK_SB_ENTRY),
|
||||
amount,
|
||||
token,
|
||||
key
|
||||
@ -463,112 +377,36 @@ contract P2PIX is
|
||||
|
||||
emit DepositWithdrawn(
|
||||
msg.sender,
|
||||
address(token),
|
||||
token,
|
||||
amount
|
||||
);
|
||||
}
|
||||
|
||||
function setRoot(address addr, bytes32 merkleroot)
|
||||
public
|
||||
{
|
||||
if (addr == msg.sender) {
|
||||
sellerAllowList[
|
||||
_castAddrToKey(addr)
|
||||
] = merkleroot;
|
||||
emit RootUpdated(addr, merkleroot);
|
||||
} else revert OnlySeller();
|
||||
}
|
||||
|
||||
/// ███ Owner Only █████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev Contract's underlying balance withdraw method.
|
||||
/// @dev Function sighash: 0x5fd8c710.
|
||||
function withdrawBalance() external onlyOwner {
|
||||
uint256 balance = address(this).balance;
|
||||
SafeTransferLib.safeTransferETH(msg.sender, balance);
|
||||
emit FundsWithdrawn(msg.sender, balance);
|
||||
}
|
||||
|
||||
function setReputation(IReputation _reputation)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
assembly {
|
||||
sstore(reputation.slot, _reputation)
|
||||
}
|
||||
emit ReputationUpdated(address(_reputation));
|
||||
}
|
||||
|
||||
function setDefaultLockBlocks(uint256 _blocks)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
assembly {
|
||||
sstore(defaultLockBlocks.slot, _blocks)
|
||||
}
|
||||
emit LockBlocksUpdated(_blocks);
|
||||
}
|
||||
|
||||
function setValidSigners(address[] memory _validSigners)
|
||||
public
|
||||
onlyOwner
|
||||
{
|
||||
unchecked {
|
||||
uint256 i;
|
||||
uint256 len = _validSigners.length;
|
||||
for (i; i < len; ) {
|
||||
uint256 key = _castAddrToKey(
|
||||
_validSigners[i]
|
||||
);
|
||||
validBacenSigners[key] = true;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
emit ValidSignersUpdated(_validSigners);
|
||||
}
|
||||
|
||||
function tokenSettings(
|
||||
address[] memory _tokens,
|
||||
bool[] memory _states
|
||||
) public onlyOwner {
|
||||
/* Yul Impl */
|
||||
assembly {
|
||||
// first 32 bytes eq to array's length
|
||||
let tLen := mload(_tokens)
|
||||
// NoTokens()
|
||||
if iszero(tLen) {
|
||||
mstore(0x00, 0xdf957883)
|
||||
// if (addr != msg.sender)
|
||||
if iszero(eq(addr, caller())) {
|
||||
// revert OnlySeller()
|
||||
mstore(0x00, 0x85d1f726)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// LengthMismatch()
|
||||
if iszero(eq(tLen, mload(_states))) {
|
||||
mstore(0x00, 0xff633a38)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
let tLoc := add(_tokens, 0x20)
|
||||
let sLoc := add(_states, 0x20)
|
||||
for {
|
||||
let end := add(tLoc, shl(5, tLen))
|
||||
} iszero(eq(tLoc, end)) {
|
||||
tLoc := add(tLoc, 0x20)
|
||||
sLoc := add(sLoc, 0x20)
|
||||
} {
|
||||
// cache hashmap entry in scratch space
|
||||
mstore(0x00, mload(tLoc))
|
||||
mstore(0x20, allowedERC20s.slot)
|
||||
let mapSlot := keccak256(0x00, 0x40)
|
||||
sstore(mapSlot, mload(sLoc))
|
||||
// sets root to SellerAllowlist's storage slot
|
||||
mstore(0x0c, _SELLER_ALLOWLIST_SLOT_SEED)
|
||||
mstore(0x00, addr)
|
||||
sstore(keccak256(0x00, 0x20), merkleroot)
|
||||
|
||||
// emit RootUpdated(addr, merkleroot);
|
||||
log3(
|
||||
0,
|
||||
0,
|
||||
// AllowedERC20Updated(address, bool)
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a,
|
||||
mload(tLoc),
|
||||
mload(sLoc)
|
||||
_ROOT_UPDATED_EVENT_SIGNATURE,
|
||||
addr,
|
||||
merkleroot
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ███ Helper FX ██████████████████████████████████████████████████████████
|
||||
|
||||
@ -592,10 +430,12 @@ contract P2PIX is
|
||||
DT.Lock memory _l,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) internal {
|
||||
) internal returns(uint256 counter){
|
||||
mapLocks[_lockID] = _l;
|
||||
|
||||
_decBal(_bal, _amount, _t, _k);
|
||||
lockCounter++;
|
||||
counter = _lockID;
|
||||
|
||||
emit LockAdded(
|
||||
_l.buyerAddress,
|
||||
@ -605,81 +445,6 @@ contract P2PIX is
|
||||
);
|
||||
}
|
||||
|
||||
function merkleVerify(
|
||||
bytes32[] calldata _merkleProof,
|
||||
bytes32 root,
|
||||
address _addr
|
||||
) private pure {
|
||||
if (
|
||||
!Merkle.verify(
|
||||
_merkleProof,
|
||||
root,
|
||||
bytes32(uint256(uint160(_addr)))
|
||||
)
|
||||
) revert AddressDenied();
|
||||
}
|
||||
|
||||
function _limiter(uint256 _userCredit)
|
||||
internal
|
||||
view
|
||||
returns (uint256 _spendLimit)
|
||||
{
|
||||
// enconde the fx sighash and args
|
||||
bytes memory encodedParams = abi.encodeWithSelector(
|
||||
IReputation.limiter.selector,
|
||||
_userCredit
|
||||
);
|
||||
// cast the uninitialized return values to memory
|
||||
bool success;
|
||||
uint256 returnSize;
|
||||
uint256 returnValue;
|
||||
// perform staticcall from the stack w yul
|
||||
assembly {
|
||||
success := staticcall(
|
||||
// gas
|
||||
0x7530,
|
||||
// address
|
||||
sload(reputation.slot),
|
||||
// argsOffset
|
||||
add(encodedParams, 0x20),
|
||||
// argsSize
|
||||
mload(encodedParams),
|
||||
// retOffset
|
||||
0x00,
|
||||
// retSize
|
||||
0x20
|
||||
)
|
||||
returnSize := returndatasize()
|
||||
returnValue := mload(0x00)
|
||||
_spendLimit := returnValue
|
||||
// reverts if call does not succeed.
|
||||
if iszero(success) {
|
||||
mstore(0x00, 0xe10bf1cc)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _castToUint(
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid
|
||||
)
|
||||
private
|
||||
pure
|
||||
returns (
|
||||
uint256 _amountCasted,
|
||||
uint256 _pixTargetCasted,
|
||||
uint256 _validCasted
|
||||
)
|
||||
{
|
||||
assembly {
|
||||
_amountCasted := _amount
|
||||
_pixTargetCasted := _pixTarget
|
||||
_validCasted := _valid
|
||||
}
|
||||
}
|
||||
|
||||
function _decBal(
|
||||
uint256 _bal,
|
||||
uint256 _amount,
|
||||
@ -691,7 +456,7 @@ contract P2PIX is
|
||||
iszero(
|
||||
or(
|
||||
iszero(_bal),
|
||||
lt(sub(_bal, _amount), 0x0)
|
||||
gt(sub(_bal, _amount), _bal)
|
||||
)
|
||||
)
|
||||
) {
|
||||
@ -702,7 +467,7 @@ contract P2PIX is
|
||||
}
|
||||
|
||||
// we can directly dec from packed uint entry value
|
||||
sellerBalance[_k][_t] -= _amount;
|
||||
_decSellerBalance(_k,_t, _amount);
|
||||
}
|
||||
|
||||
function getBalance(address seller, ERC20 token)
|
||||
@ -716,17 +481,15 @@ contract P2PIX is
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(0x0) {
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0x00, shl(0xC, seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
bal := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
sload(keccak256(0x00, 0x40))
|
||||
sload(keccak256(0x0c, 0x34))
|
||||
)
|
||||
break
|
||||
}
|
||||
@ -745,19 +508,17 @@ contract P2PIX is
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(0x0) {
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0x00, shl(0xC, seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
valid := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
shr(
|
||||
BITPOS_VALID,
|
||||
sload(keccak256(0x00, 0x40))
|
||||
sload(keccak256(0x0c, 0x34))
|
||||
)
|
||||
)
|
||||
break
|
||||
@ -777,17 +538,15 @@ contract P2PIX is
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(0) {
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0, shl(12, seller))
|
||||
mstore(32, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0, 64)
|
||||
mstore(0, token)
|
||||
mstore(32, sbkslot)
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
pixTarget := shr(
|
||||
BITPOS_PIXTARGET,
|
||||
sload(keccak256(0, 64))
|
||||
sload(keccak256(0x0c, 0x34))
|
||||
)
|
||||
break
|
||||
}
|
||||
@ -861,28 +620,43 @@ contract P2PIX is
|
||||
return (sortedIDs, status);
|
||||
}
|
||||
|
||||
/// @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 _setSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 packed) private {
|
||||
assembly {
|
||||
_key := shl(12, _addr)
|
||||
mstore(0x20, erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
sstore(keccak256(0x0c, 0x34), packed)
|
||||
}
|
||||
}
|
||||
|
||||
function _castKeyToAddr(uint256 _key)
|
||||
public
|
||||
pure
|
||||
returns (address _addr)
|
||||
{
|
||||
// _addr = address(uint160(uint256(_key >> 12)));
|
||||
function _addSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 amount) private {
|
||||
assembly {
|
||||
_addr := shr(12, _key)
|
||||
mstore(0x20, erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
let slot := keccak256(0x0c, 0x34)
|
||||
sstore(slot, add(sload(slot), amount))
|
||||
}
|
||||
}
|
||||
|
||||
function _decSellerBalance(uint256 sellerKey, ERC20 erc20, uint256 amount) private {
|
||||
assembly {
|
||||
mstore(0x20, erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
let slot := keccak256(0x0c, 0x34)
|
||||
sstore(slot, sub(sload(slot), amount))
|
||||
}
|
||||
}
|
||||
|
||||
function sellerBalance(uint256 sellerKey, ERC20 erc20) public view returns(uint256 packed) {
|
||||
assembly {
|
||||
mstore(0x20, erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
packed := sload(keccak256(0x0c, 0x34))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import { config as dotenvConfig } from "dotenv";
|
||||
import "hardhat-tracer";
|
||||
import { HardhatUserConfig } from "hardhat/config";
|
||||
import { NetworkUserConfig } from "hardhat/types";
|
||||
import "hardhat-contract-sizer";
|
||||
import { resolve } from "path";
|
||||
|
||||
dotenvConfig({ path: resolve(__dirname, "./.env") });
|
||||
@ -74,17 +75,6 @@ const config: HardhatUserConfig = {
|
||||
goerli: process.env.ETHERSCAN_API_KEY || "",
|
||||
polygonMumbai: process.env.POLYGONSCAN_API_KEY || "",
|
||||
},
|
||||
// customChains: [
|
||||
// {
|
||||
// // network: {INSERT_NAME},
|
||||
// // chainId: {INSERT_ID},
|
||||
// // urls: {
|
||||
// // apiURL:
|
||||
// // "{INSERT_URL}",
|
||||
// // browserURL: "{INSERT_URL}",
|
||||
// // },
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
gasReporter: {
|
||||
enabled: !!(
|
||||
@ -121,16 +111,24 @@ const config: HardhatUserConfig = {
|
||||
tests: "./test",
|
||||
},
|
||||
solidity: {
|
||||
version: "0.8.9",
|
||||
version: "0.8.19",
|
||||
settings: {
|
||||
// viaIR: true,
|
||||
metadata: {
|
||||
bytecodeHash: "none",
|
||||
},
|
||||
viaIR: true,
|
||||
evmVersion: "paris",
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
// max val = 4_294_967_295
|
||||
runs: 20_000,
|
||||
details: {
|
||||
deduplicate: true,
|
||||
cse: true,
|
||||
constantOptimizer: true,
|
||||
peephole: true,
|
||||
jumpdestRemover: true,
|
||||
yul: true,
|
||||
yulDetails: {
|
||||
stackAllocation: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -63,6 +63,7 @@
|
||||
"ethers": "^5.7.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"hardhat": "^2.12.2",
|
||||
"hardhat-contract-sizer": "^2.8.0",
|
||||
"hardhat-gas-reporter": "^1.0.9",
|
||||
"hardhat-tracer": "beta",
|
||||
"husky": "^8.0.1",
|
||||
|
@ -7,17 +7,11 @@ import type {
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
@ -32,17 +26,10 @@ export interface ReputationInterface extends utils.Interface {
|
||||
"limiter(uint256)": FunctionFragment;
|
||||
"magicValue()": FunctionFragment;
|
||||
"maxLimit()": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "limiter"
|
||||
| "magicValue"
|
||||
| "maxLimit"
|
||||
| "owner"
|
||||
| "setOwner"
|
||||
nameOrSignatureOrTopic: "limiter" | "magicValue" | "maxLimit"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
@ -54,36 +41,14 @@ export interface ReputationInterface extends utils.Interface {
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "maxLimit", values?: undefined): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "limiter", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "magicValue", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "maxLimit", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
|
||||
events: {
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface Reputation extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
@ -119,13 +84,6 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
limiter(
|
||||
@ -137,13 +95,6 @@ export interface Reputation extends BaseContract {
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
@ -153,25 +104,9 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
};
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
limiter(
|
||||
@ -182,13 +117,6 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
@ -200,12 +128,5 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
|
835
src/types/core/BaseUtils.ts
Normal file
835
src/types/core/BaseUtils.ts
Normal file
@ -0,0 +1,835 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../common";
|
||||
|
||||
export interface BaseUtilsInterface extends utils.Interface {
|
||||
functions: {
|
||||
"_castAddrToKey(address)": FunctionFragment;
|
||||
"_castKeyToAddr(uint256)": FunctionFragment;
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
"defaultLockBlocks()": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"setDefaultLockBlocks(uint256)": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
"setReputation(address)": FunctionFragment;
|
||||
"setValidSigners(address[])": FunctionFragment;
|
||||
"tokenSettings(address[],bool[])": FunctionFragment;
|
||||
"usedTransactions(bytes32)": FunctionFragment;
|
||||
"validBacenSigners(uint256)": FunctionFragment;
|
||||
"withdrawBalance()": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "_castAddrToKey"
|
||||
| "_castKeyToAddr"
|
||||
| "allowedERC20s"
|
||||
| "defaultLockBlocks"
|
||||
| "owner"
|
||||
| "reputation"
|
||||
| "sellerAllowList"
|
||||
| "setDefaultLockBlocks"
|
||||
| "setOwner"
|
||||
| "setReputation"
|
||||
| "setValidSigners"
|
||||
| "tokenSettings"
|
||||
| "usedTransactions"
|
||||
| "validBacenSigners"
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castAddrToKey",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castKeyToAddr",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowedERC20s",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "reputation",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "sellerAllowList",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setReputation",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setValidSigners",
|
||||
values: [PromiseOrValue<string>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "tokenSettings",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "usedTransactions",
|
||||
values: [PromiseOrValue<BytesLike>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "validBacenSigners",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdrawBalance",
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castAddrToKey",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castKeyToAddr",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "allowedERC20s",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "sellerAllowList",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setReputation",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setValidSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "tokenSettings",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "usedTransactions",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "validBacenSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "withdrawBalance",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"AllowedERC20Updated(address,bool)": EventFragment;
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
"ValidSet(address,address,bool)": EventFragment;
|
||||
"ValidSignersUpdated(address[])": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "AllowedERC20Updated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "FundsWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockBlocksUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReleased"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReturned"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment;
|
||||
}
|
||||
|
||||
export interface AllowedERC20UpdatedEventObject {
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type AllowedERC20UpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
AllowedERC20UpdatedEventObject
|
||||
>;
|
||||
|
||||
export type AllowedERC20UpdatedEventFilter =
|
||||
TypedEventFilter<AllowedERC20UpdatedEvent>;
|
||||
|
||||
export interface DepositAddedEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositAddedEventObject
|
||||
>;
|
||||
|
||||
export type DepositAddedEventFilter = TypedEventFilter<DepositAddedEvent>;
|
||||
|
||||
export interface DepositWithdrawnEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositWithdrawnEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type DepositWithdrawnEventFilter =
|
||||
TypedEventFilter<DepositWithdrawnEvent>;
|
||||
|
||||
export interface FundsWithdrawnEventObject {
|
||||
owner: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type FundsWithdrawnEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
FundsWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
export type LockAddedEventFilter = TypedEventFilter<LockAddedEvent>;
|
||||
|
||||
export interface LockBlocksUpdatedEventObject {
|
||||
blocks: BigNumber;
|
||||
}
|
||||
export type LockBlocksUpdatedEvent = TypedEvent<
|
||||
[BigNumber],
|
||||
LockBlocksUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type LockBlocksUpdatedEventFilter =
|
||||
TypedEventFilter<LockBlocksUpdatedEvent>;
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
export type LockReturnedEventFilter = TypedEventFilter<LockReturnedEvent>;
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface ReputationUpdatedEventObject {
|
||||
reputation: string;
|
||||
}
|
||||
export type ReputationUpdatedEvent = TypedEvent<
|
||||
[string],
|
||||
ReputationUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ReputationUpdatedEventFilter =
|
||||
TypedEventFilter<ReputationUpdatedEvent>;
|
||||
|
||||
export interface RootUpdatedEventObject {
|
||||
seller: string;
|
||||
merkleRoot: string;
|
||||
}
|
||||
export type RootUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
RootUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
||||
|
||||
export interface ValidSetEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type ValidSetEvent = TypedEvent<
|
||||
[string, string, boolean],
|
||||
ValidSetEventObject
|
||||
>;
|
||||
|
||||
export type ValidSetEventFilter = TypedEventFilter<ValidSetEvent>;
|
||||
|
||||
export interface ValidSignersUpdatedEventObject {
|
||||
signers: string[];
|
||||
}
|
||||
export type ValidSignersUpdatedEvent = TypedEvent<
|
||||
[string[]],
|
||||
ValidSignersUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ValidSignersUpdatedEventFilter =
|
||||
TypedEventFilter<ValidSignersUpdatedEvent>;
|
||||
|
||||
export interface BaseUtils extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: BaseUtilsInterface;
|
||||
|
||||
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: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { _key: BigNumber }>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { _addr: string }>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { state: boolean }>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { root: string }>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { used: boolean }>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { valid: boolean }>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(overrides?: CallOverrides): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"AllowedERC20Updated(address,bool)"(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
AllowedERC20Updated(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
|
||||
"DepositAdded(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
DepositAdded(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
|
||||
"DepositWithdrawn(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
DepositWithdrawn(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
|
||||
"FundsWithdrawn(address,uint256)"(
|
||||
owner?: null,
|
||||
amount?: null
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
LockReleased(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
LockReturned(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
|
||||
"ReputationUpdated(address)"(
|
||||
reputation?: null
|
||||
): ReputationUpdatedEventFilter;
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
ValidSet(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
|
||||
"ValidSignersUpdated(address[])"(
|
||||
signers?: null
|
||||
): ValidSignersUpdatedEventFilter;
|
||||
ValidSignersUpdated(signers?: null): ValidSignersUpdatedEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
@ -5,6 +5,7 @@ import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
@ -16,7 +17,7 @@ import type {
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "./common";
|
||||
} from "../common";
|
||||
|
||||
export interface EventAndErrorsInterface extends utils.Interface {
|
||||
functions: {};
|
||||
@ -300,10 +301,13 @@ export interface EventAndErrors extends BaseContract {
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: null,
|
||||
merkleRoot?: null
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(seller?: null, merkleRoot?: null): RootUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
730
src/types/core/OwnerSettings.ts
Normal file
730
src/types/core/OwnerSettings.ts
Normal file
@ -0,0 +1,730 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../common";
|
||||
|
||||
export interface OwnerSettingsInterface extends utils.Interface {
|
||||
functions: {
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
"defaultLockBlocks()": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"setDefaultLockBlocks(uint256)": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
"setReputation(address)": FunctionFragment;
|
||||
"setValidSigners(address[])": FunctionFragment;
|
||||
"tokenSettings(address[],bool[])": FunctionFragment;
|
||||
"validBacenSigners(uint256)": FunctionFragment;
|
||||
"withdrawBalance()": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "allowedERC20s"
|
||||
| "defaultLockBlocks"
|
||||
| "owner"
|
||||
| "reputation"
|
||||
| "sellerAllowList"
|
||||
| "setDefaultLockBlocks"
|
||||
| "setOwner"
|
||||
| "setReputation"
|
||||
| "setValidSigners"
|
||||
| "tokenSettings"
|
||||
| "validBacenSigners"
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowedERC20s",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "reputation",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "sellerAllowList",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setReputation",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setValidSigners",
|
||||
values: [PromiseOrValue<string>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "tokenSettings",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "validBacenSigners",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdrawBalance",
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "allowedERC20s",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "sellerAllowList",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setReputation",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setValidSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "tokenSettings",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "validBacenSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "withdrawBalance",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"AllowedERC20Updated(address,bool)": EventFragment;
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
"ValidSet(address,address,bool)": EventFragment;
|
||||
"ValidSignersUpdated(address[])": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "AllowedERC20Updated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "FundsWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockBlocksUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReleased"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReturned"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment;
|
||||
}
|
||||
|
||||
export interface AllowedERC20UpdatedEventObject {
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type AllowedERC20UpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
AllowedERC20UpdatedEventObject
|
||||
>;
|
||||
|
||||
export type AllowedERC20UpdatedEventFilter =
|
||||
TypedEventFilter<AllowedERC20UpdatedEvent>;
|
||||
|
||||
export interface DepositAddedEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositAddedEventObject
|
||||
>;
|
||||
|
||||
export type DepositAddedEventFilter = TypedEventFilter<DepositAddedEvent>;
|
||||
|
||||
export interface DepositWithdrawnEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositWithdrawnEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type DepositWithdrawnEventFilter =
|
||||
TypedEventFilter<DepositWithdrawnEvent>;
|
||||
|
||||
export interface FundsWithdrawnEventObject {
|
||||
owner: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type FundsWithdrawnEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
FundsWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
export type LockAddedEventFilter = TypedEventFilter<LockAddedEvent>;
|
||||
|
||||
export interface LockBlocksUpdatedEventObject {
|
||||
blocks: BigNumber;
|
||||
}
|
||||
export type LockBlocksUpdatedEvent = TypedEvent<
|
||||
[BigNumber],
|
||||
LockBlocksUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type LockBlocksUpdatedEventFilter =
|
||||
TypedEventFilter<LockBlocksUpdatedEvent>;
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
export type LockReturnedEventFilter = TypedEventFilter<LockReturnedEvent>;
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface ReputationUpdatedEventObject {
|
||||
reputation: string;
|
||||
}
|
||||
export type ReputationUpdatedEvent = TypedEvent<
|
||||
[string],
|
||||
ReputationUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ReputationUpdatedEventFilter =
|
||||
TypedEventFilter<ReputationUpdatedEvent>;
|
||||
|
||||
export interface RootUpdatedEventObject {
|
||||
seller: string;
|
||||
merkleRoot: string;
|
||||
}
|
||||
export type RootUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
RootUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
||||
|
||||
export interface ValidSetEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type ValidSetEvent = TypedEvent<
|
||||
[string, string, boolean],
|
||||
ValidSetEventObject
|
||||
>;
|
||||
|
||||
export type ValidSetEventFilter = TypedEventFilter<ValidSetEvent>;
|
||||
|
||||
export interface ValidSignersUpdatedEventObject {
|
||||
signers: string[];
|
||||
}
|
||||
export type ValidSignersUpdatedEvent = TypedEvent<
|
||||
[string[]],
|
||||
ValidSignersUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ValidSignersUpdatedEventFilter =
|
||||
TypedEventFilter<ValidSignersUpdatedEvent>;
|
||||
|
||||
export interface OwnerSettings extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: OwnerSettingsInterface;
|
||||
|
||||
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: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { state: boolean }>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { root: string }>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { valid: boolean }>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(overrides?: CallOverrides): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"AllowedERC20Updated(address,bool)"(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
AllowedERC20Updated(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
|
||||
"DepositAdded(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
DepositAdded(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
|
||||
"DepositWithdrawn(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
DepositWithdrawn(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
|
||||
"FundsWithdrawn(address,uint256)"(
|
||||
owner?: null,
|
||||
amount?: null
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
LockReleased(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
LockReturned(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
|
||||
"ReputationUpdated(address)"(
|
||||
reputation?: null
|
||||
): ReputationUpdatedEventFilter;
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
ValidSet(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
|
||||
"ValidSignersUpdated(address[])"(
|
||||
signers?: null
|
||||
): ValidSignersUpdatedEventFilter;
|
||||
ValidSignersUpdated(signers?: null): ValidSignersUpdatedEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
6
src/types/core/index.ts
Normal file
6
src/types/core/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { BaseUtils } from "./BaseUtils";
|
||||
export type { EventAndErrors } from "./EventAndErrors";
|
||||
export type { OwnerSettings } from "./OwnerSettings";
|
@ -12,25 +12,6 @@ const _abi = [
|
||||
stateMutability: "nonpayable",
|
||||
type: "constructor",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
@ -76,36 +57,10 @@ const _abi = [
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350610416806100616000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80634d2b1791116100505780634d2b17911461009e5780638da5cb5b146100b1578063a4b34557146100f657600080fd5b806313af40351461006c5780631a861d2614610081575b600080fd5b61007f61007a3660046102f4565b610102565b005b61008b620f424081565b6040519081526020015b60405180910390f35b61008b6100ac366004610331565b6101f7565b6000546100d19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610095565b61008b643a3529440081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a45440000000000000000000000000000000000000000604482015260640160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600061021a6102068380610379565b61021590643a352944006103b6565b610242565b61022783620f4240610379565b61023191906103ce565b61023c9060016103b6565b92915050565b60b5817101000000000000000000000000000000000081106102695760409190911b9060801c5b690100000000000000000081106102855760209190911b9060401c5b65010000000000811061029d5760109190911b9060201c5b630100000081106102b35760089190911b9060101c5b62010000010260121c80820401600190811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900390565b60006020828403121561030657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461032a57600080fd5b9392505050565b60006020828403121561034357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156103b1576103b161034a565b500290565b600082198211156103c9576103c961034a565b500190565b600082610404577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea164736f6c6343000809000a";
|
||||
"0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033";
|
||||
|
||||
type ReputationConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
618
src/types/factories/core/BaseUtils__factory.ts
Normal file
618
src/types/factories/core/BaseUtils__factory.ts
Normal file
@ -0,0 +1,618 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type { BaseUtils, BaseUtilsInterface } from "../../core/BaseUtils";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "AddressDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AlreadyReleased",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AmountNotAllowed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "EmptyPixTarget",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidDeposit",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSigner",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LengthMismatch",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LockExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LoopOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "MaxBalExceeded",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NoTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotEnoughTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotInitialized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "OnlySeller",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "StaticCallFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TokenDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TxAlreadyUsed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "AllowedERC20Updated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "FundsWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "seller",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockBlocksUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReleased",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "ValidSet",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address[]",
|
||||
name: "signers",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "_addr",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "_castAddrToKey",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_key",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_key",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "_castKeyToAddr",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "_addr",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20",
|
||||
name: "erc20",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "allowedERC20s",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "defaultLockBlocks",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "reputation",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "sellerKey",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "sellerAllowList",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "setDefaultLockBlocks",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "_reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setReputation",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "_validSigners",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "setValidSigners",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20[]",
|
||||
name: "_tokens",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "_states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "tokenSettings",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "message",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "usedTransactions",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "used",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "signer",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "validBacenSigners",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "valid",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "withdrawBalance",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class BaseUtils__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): BaseUtilsInterface {
|
||||
return new utils.Interface(_abi) as BaseUtilsInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): BaseUtils {
|
||||
return new Contract(address, _abi, signerOrProvider) as BaseUtils;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
EventAndErrors,
|
||||
EventAndErrorsInterface,
|
||||
} from "../EventAndErrors";
|
||||
} from "../../core/EventAndErrors";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
@ -30,11 +30,6 @@ const _abi = [
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DepositAlreadyExists",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "EmptyPixTarget",
|
||||
@ -140,7 +135,7 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
@ -165,7 +160,7 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
@ -303,13 +298,13 @@ const _abi = [
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
@ -329,7 +324,7 @@ const _abi = [
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
564
src/types/factories/core/OwnerSettings__factory.ts
Normal file
564
src/types/factories/core/OwnerSettings__factory.ts
Normal file
@ -0,0 +1,564 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
OwnerSettings,
|
||||
OwnerSettingsInterface,
|
||||
} from "../../core/OwnerSettings";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "AddressDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AlreadyReleased",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AmountNotAllowed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "EmptyPixTarget",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidDeposit",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSigner",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LengthMismatch",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LockExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LoopOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "MaxBalExceeded",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NoTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotEnoughTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotInitialized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "OnlySeller",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "StaticCallFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TokenDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TxAlreadyUsed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "AllowedERC20Updated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "FundsWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "seller",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockBlocksUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReleased",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "ValidSet",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address[]",
|
||||
name: "signers",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20",
|
||||
name: "erc20",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "allowedERC20s",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "defaultLockBlocks",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "reputation",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "sellerKey",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "sellerAllowList",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "setDefaultLockBlocks",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "_reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setReputation",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "_validSigners",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "setValidSigners",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20[]",
|
||||
name: "_tokens",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "_states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "tokenSettings",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "signer",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "validBacenSigners",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "valid",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "withdrawBalance",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class OwnerSettings__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): OwnerSettingsInterface {
|
||||
return new utils.Interface(_abi) as OwnerSettingsInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): OwnerSettings {
|
||||
return new Contract(address, _abi, signerOrProvider) as OwnerSettings;
|
||||
}
|
||||
}
|
6
src/types/factories/core/index.ts
Normal file
6
src/types/factories/core/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { BaseUtils__factory } from "./BaseUtils__factory";
|
||||
export { EventAndErrors__factory } from "./EventAndErrors__factory";
|
||||
export { OwnerSettings__factory } from "./OwnerSettings__factory";
|
@ -1,7 +1,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * as core from "./core";
|
||||
export * as lib from "./lib";
|
||||
export * as p2PixSol from "./p2pix.sol";
|
||||
export { EventAndErrors__factory } from "./EventAndErrors__factory";
|
||||
export { Reputation__factory } from "./Reputation__factory";
|
||||
|
@ -7,6 +7,11 @@ import type { Provider } from "@ethersproject/providers";
|
||||
import type { Owned, OwnedInterface } from "../../../lib/auth/Owned";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
|
File diff suppressed because one or more lines are too long
62
src/types/factories/lib/utils/ECDSA__factory.ts
Normal file
62
src/types/factories/lib/utils/ECDSA__factory.ts
Normal file
@ -0,0 +1,62 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
|
||||
import type { Provider, TransactionRequest } from "@ethersproject/providers";
|
||||
import type { PromiseOrValue } from "../../../common";
|
||||
import type { ECDSA, ECDSAInterface } from "../../../lib/utils/ECDSA";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSignature",
|
||||
type: "error",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033";
|
||||
|
||||
type ECDSAConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: ECDSAConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class ECDSA__factory extends ContractFactory {
|
||||
constructor(...args: ECDSAConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ECDSA> {
|
||||
return super.deploy(overrides || {}) as Promise<ECDSA>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): ECDSA {
|
||||
return super.attach(address) as ECDSA;
|
||||
}
|
||||
override connect(signer: Signer): ECDSA__factory {
|
||||
return super.connect(signer) as ECDSA__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): ECDSAInterface {
|
||||
return new utils.Interface(_abi) as ECDSAInterface;
|
||||
}
|
||||
static connect(address: string, signerOrProvider: Signer | Provider): ECDSA {
|
||||
return new Contract(address, _abi, signerOrProvider) as ECDSA;
|
||||
}
|
||||
}
|
@ -124,7 +124,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60806040526108ec806100136000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a";
|
||||
"0x6080806040526107fb90816100128239f3fe604060808152600436101561001357600080fd5b6000803560e01c9182631b57b72f1461003c5750506386575ee91461003757600080fd5b610362565b3461015e5761004a36610162565b61005e61005982949394610523565b6104df565b928184527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061008c83610523565b01855b81811061013e575050845b8281106100b6578351806100b2874380409084610238565b0390f35b806100cd6100c86101399386866105c7565b61060c565b87806100da8488886105c7565b92816100eb6020958681019061062d565b91906100fb8c518094819361067e565b03925af1906101086106c6565b9061011b6101146104ba565b9315158452565b8201526101288288610755565b526101338187610755565b50610769565b61009a565b6020906101496104ba565b8881528260608183015282890101520161008f565b5080fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101cd5760043567ffffffffffffffff928382116101cd57806023830112156101cd5781600401359384116101cd5760248460051b830101116101cd576024019190565b600080fd5b60005b8381106101e55750506000910152565b81810151838201526020016101d5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610231815180928187528780880191016101d2565b0116010190565b9160608301918352602090818401526040926060848201528451809352608081018260808560051b8401019601946000925b85841061027b575050505050505090565b9091929394959685806102ca837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80866001960301885286838d51805115158452015191818582015201906101f5565b99019401940192959493919061026a565b90604082019082526020604081840152835180925260608301928160608460051b8301019501936000915b8483106103165750505050505090565b9091929394958480610352837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086600196030187528a516101f5565b9801930193019194939290610306565b346101cd5761037036610162565b6103798161053b565b916000805b83811061039457604051806100b28743836102db565b6103a26100c88286866105c7565b82806103bc6103b28589896105c7565b602081019061062d565b82604095926103cf87518094819361067e565b03925af1906103dc6106c6565b918290156103fa575050906103f5916101288288610755565b61037e565b604483929351106104535761042061044f916004809401602480915183010191016106ec565b92519283927fb5e1dc2d0000000000000000000000000000000000000000000000000000000084528301610744565b0390fd5b82517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604490fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051906040820182811067ffffffffffffffff8211176104da57604052565b61048b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176104da57604052565b67ffffffffffffffff81116104da5760051b60200190565b9061054861005983610523565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06105768294610523565b019060005b82811061058757505050565b80606060208093850101520161057b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156106075760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1813603018212156101cd570190565b610598565b3573ffffffffffffffffffffffffffffffffffffffff811681036101cd5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101cd570180359067ffffffffffffffff82116101cd576020019181360383136101cd57565b908092918237016000815290565b67ffffffffffffffff81116104da57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156106e7573d906106da6100598361068c565b9182523d6000602084013e565b606090565b6020818303126101cd5780519067ffffffffffffffff82116101cd570181601f820112156101cd5780516107226100598261068c565b92818452602082840101116101cd5761074191602080850191016101d2565b90565b9060206107419281815201906101f5565b80518210156106075760209160051b010190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212206c86e7cf81738039d37cf5e545b323288faae992e0d08dec8c43f2f2b31f35f664736f6c63430008130033";
|
||||
|
||||
type MulticallConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
78
src/types/factories/lib/utils/SafeTransferLib__factory.ts
Normal file
78
src/types/factories/lib/utils/SafeTransferLib__factory.ts
Normal file
@ -0,0 +1,78 @@
|
||||
/* 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 {
|
||||
SafeTransferLib,
|
||||
SafeTransferLibInterface,
|
||||
} from "../../../lib/utils/SafeTransferLib";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "ETHTransferFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TransferFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TransferFromFailed",
|
||||
type: "error",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220007e83452e6dfca4997d94ba5608da3c2308815d3239b1810079c74651f15a7464736f6c63430008130033";
|
||||
|
||||
type SafeTransferLibConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: SafeTransferLibConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class SafeTransferLib__factory extends ContractFactory {
|
||||
constructor(...args: SafeTransferLibConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<SafeTransferLib> {
|
||||
return super.deploy(overrides || {}) as Promise<SafeTransferLib>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): SafeTransferLib {
|
||||
return super.attach(address) as SafeTransferLib;
|
||||
}
|
||||
override connect(signer: Signer): SafeTransferLib__factory {
|
||||
return super.connect(signer) as SafeTransferLib__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): SafeTransferLibInterface {
|
||||
return new utils.Interface(_abi) as SafeTransferLibInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): SafeTransferLib {
|
||||
return new Contract(address, _abi, signerOrProvider) as SafeTransferLib;
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { ECDSA__factory } from "./ECDSA__factory";
|
||||
export { Multicall__factory } from "./Multicall__factory";
|
||||
export { ReentrancyGuard__factory } from "./ReentrancyGuard__factory";
|
||||
export { SafeTransferLib__factory } from "./SafeTransferLib__factory";
|
||||
|
File diff suppressed because one or more lines are too long
36
src/types/hardhat.d.ts
vendored
36
src/types/hardhat.d.ts
vendored
@ -12,10 +12,18 @@ import * as Contracts from ".";
|
||||
|
||||
declare module "hardhat/types/runtime" {
|
||||
interface HardhatEthersHelpers extends HardhatEthersHelpersBase {
|
||||
getContractFactory(
|
||||
name: "BaseUtils",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.BaseUtils__factory>;
|
||||
getContractFactory(
|
||||
name: "EventAndErrors",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.EventAndErrors__factory>;
|
||||
getContractFactory(
|
||||
name: "OwnerSettings",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.OwnerSettings__factory>;
|
||||
getContractFactory(
|
||||
name: "Owned",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
@ -32,6 +40,10 @@ declare module "hardhat/types/runtime" {
|
||||
name: "ERC20",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ERC20__factory>;
|
||||
getContractFactory(
|
||||
name: "ECDSA",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ECDSA__factory>;
|
||||
getContractFactory(
|
||||
name: "Multicall",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
@ -40,6 +52,10 @@ declare module "hardhat/types/runtime" {
|
||||
name: "ReentrancyGuard",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ReentrancyGuard__factory>;
|
||||
getContractFactory(
|
||||
name: "SafeTransferLib",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.SafeTransferLib__factory>;
|
||||
getContractFactory(
|
||||
name: "P2PIX",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
@ -49,11 +65,21 @@ declare module "hardhat/types/runtime" {
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.Reputation__factory>;
|
||||
|
||||
getContractAt(
|
||||
name: "BaseUtils",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.BaseUtils>;
|
||||
getContractAt(
|
||||
name: "EventAndErrors",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.EventAndErrors>;
|
||||
getContractAt(
|
||||
name: "OwnerSettings",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.OwnerSettings>;
|
||||
getContractAt(
|
||||
name: "Owned",
|
||||
address: string,
|
||||
@ -74,6 +100,11 @@ declare module "hardhat/types/runtime" {
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ERC20>;
|
||||
getContractAt(
|
||||
name: "ECDSA",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ECDSA>;
|
||||
getContractAt(
|
||||
name: "Multicall",
|
||||
address: string,
|
||||
@ -84,6 +115,11 @@ declare module "hardhat/types/runtime" {
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ReentrancyGuard>;
|
||||
getContractAt(
|
||||
name: "SafeTransferLib",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.SafeTransferLib>;
|
||||
getContractAt(
|
||||
name: "P2PIX",
|
||||
address: string,
|
||||
|
@ -1,14 +1,20 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type * as core from "./core";
|
||||
export type { core };
|
||||
import type * as lib from "./lib";
|
||||
export type { lib };
|
||||
import type * as p2PixSol from "./p2pix.sol";
|
||||
export type { p2PixSol };
|
||||
export type { EventAndErrors } from "./EventAndErrors";
|
||||
export type { Reputation } from "./Reputation";
|
||||
export * as factories from "./factories";
|
||||
export { EventAndErrors__factory } from "./factories/EventAndErrors__factory";
|
||||
export type { BaseUtils } from "./core/BaseUtils";
|
||||
export { BaseUtils__factory } from "./factories/core/BaseUtils__factory";
|
||||
export type { EventAndErrors } from "./core/EventAndErrors";
|
||||
export { EventAndErrors__factory } from "./factories/core/EventAndErrors__factory";
|
||||
export type { OwnerSettings } from "./core/OwnerSettings";
|
||||
export { OwnerSettings__factory } from "./factories/core/OwnerSettings__factory";
|
||||
export type { Owned } from "./lib/auth/Owned";
|
||||
export { Owned__factory } from "./factories/lib/auth/Owned__factory";
|
||||
export type { IReputation } from "./lib/interfaces/IReputation";
|
||||
@ -17,10 +23,14 @@ export type { MockToken } from "./lib/mock/mockToken.sol/MockToken";
|
||||
export { MockToken__factory } from "./factories/lib/mock/mockToken.sol/MockToken__factory";
|
||||
export type { ERC20 } from "./lib/tokens/ERC20";
|
||||
export { ERC20__factory } from "./factories/lib/tokens/ERC20__factory";
|
||||
export type { ECDSA } from "./lib/utils/ECDSA";
|
||||
export { ECDSA__factory } from "./factories/lib/utils/ECDSA__factory";
|
||||
export type { Multicall } from "./lib/utils/Multicall";
|
||||
export { Multicall__factory } from "./factories/lib/utils/Multicall__factory";
|
||||
export type { ReentrancyGuard } from "./lib/utils/ReentrancyGuard";
|
||||
export { ReentrancyGuard__factory } from "./factories/lib/utils/ReentrancyGuard__factory";
|
||||
export type { SafeTransferLib } from "./lib/utils/SafeTransferLib";
|
||||
export { SafeTransferLib__factory } from "./factories/lib/utils/SafeTransferLib__factory";
|
||||
export type { P2PIX } from "./p2pix.sol/P2PIX";
|
||||
export { P2PIX__factory } from "./factories/p2pix.sol/P2PIX__factory";
|
||||
export { Reputation__factory } from "./factories/Reputation__factory";
|
||||
|
56
src/types/lib/utils/ECDSA.ts
Normal file
56
src/types/lib/utils/ECDSA.ts
Normal file
@ -0,0 +1,56 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseContract, Signer, utils } from "ethers";
|
||||
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../../common";
|
||||
|
||||
export interface ECDSAInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface ECDSA extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: ECDSAInterface;
|
||||
|
||||
queryFilter<TEvent extends TypedEvent>(
|
||||
event: TypedEventFilter<TEvent>,
|
||||
fromBlockOrBlockhash?: string | number | undefined,
|
||||
toBlock?: string | number | undefined
|
||||
): Promise<Array<TEvent>>;
|
||||
|
||||
listeners<TEvent extends TypedEvent>(
|
||||
eventFilter?: TypedEventFilter<TEvent>
|
||||
): Array<TypedListener<TEvent>>;
|
||||
listeners(eventName?: string): Array<Listener>;
|
||||
removeAllListeners<TEvent extends TypedEvent>(
|
||||
eventFilter: TypedEventFilter<TEvent>
|
||||
): this;
|
||||
removeAllListeners(eventName?: string): this;
|
||||
off: OnEvent<this>;
|
||||
on: OnEvent<this>;
|
||||
once: OnEvent<this>;
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {};
|
||||
|
||||
callStatic: {};
|
||||
|
||||
filters: {};
|
||||
|
||||
estimateGas: {};
|
||||
|
||||
populateTransaction: {};
|
||||
}
|
56
src/types/lib/utils/SafeTransferLib.ts
Normal file
56
src/types/lib/utils/SafeTransferLib.ts
Normal file
@ -0,0 +1,56 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseContract, Signer, utils } from "ethers";
|
||||
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../../common";
|
||||
|
||||
export interface SafeTransferLibInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface SafeTransferLib extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: SafeTransferLibInterface;
|
||||
|
||||
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,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { ECDSA } from "./ECDSA";
|
||||
export type { Multicall } from "./Multicall";
|
||||
export type { ReentrancyGuard } from "./ReentrancyGuard";
|
||||
export type { SafeTransferLib } from "./SafeTransferLib";
|
||||
|
@ -29,7 +29,6 @@ import type {
|
||||
|
||||
export interface P2PIXInterface extends utils.Interface {
|
||||
functions: {
|
||||
"WAD()": FunctionFragment;
|
||||
"_castAddrToKey(address)": FunctionFragment;
|
||||
"_castKeyToAddr(uint256)": FunctionFragment;
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
@ -40,11 +39,11 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
"getLocksStatus(uint256[])": FunctionFragment;
|
||||
"getPixTarget(address,address)": FunctionFragment;
|
||||
"getValid(address,address)": FunctionFragment;
|
||||
"lock(address,address,address,address,uint256,uint256,bytes32[],uint256[])": FunctionFragment;
|
||||
"lock(address,address,address,uint80,uint80,bytes32[],uint256[])": FunctionFragment;
|
||||
"lockCounter()": FunctionFragment;
|
||||
"mapLocks(uint256)": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"release(uint256,address,bytes32,bytes32,bytes32,uint8)": FunctionFragment;
|
||||
"release(uint256,bytes32,bytes32,bytes32,uint8)": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"sellerBalance(uint256,address)": FunctionFragment;
|
||||
@ -65,7 +64,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "WAD"
|
||||
| "_castAddrToKey"
|
||||
| "_castKeyToAddr"
|
||||
| "allowedERC20s"
|
||||
@ -99,7 +97,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(functionFragment: "WAD", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castAddrToKey",
|
||||
values: [PromiseOrValue<string>]
|
||||
@ -152,7 +149,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BytesLike>[],
|
||||
@ -172,7 +168,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
functionFragment: "release",
|
||||
values: [
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
@ -248,7 +243,6 @@ export interface P2PIXInterface extends utils.Interface {
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "WAD", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castAddrToKey",
|
||||
data: BytesLike
|
||||
@ -547,8 +541,6 @@ export interface P2PIX extends BaseContract {
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
WAD(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@ -560,9 +552,9 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<[string] & { _addr: string }>;
|
||||
|
||||
allowedERC20s(
|
||||
arg0: PromiseOrValue<string>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
): Promise<[boolean] & { state: boolean }>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
@ -608,7 +600,6 @@ export interface P2PIX extends BaseContract {
|
||||
_seller: PromiseOrValue<string>,
|
||||
_token: PromiseOrValue<string>,
|
||||
_buyerAddress: PromiseOrValue<string>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
@ -631,17 +622,15 @@ export interface P2PIX extends BaseContract {
|
||||
BigNumber,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerTarget: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
}
|
||||
@ -651,7 +640,6 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
@ -662,15 +650,15 @@ export interface P2PIX extends BaseContract {
|
||||
reputation(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
sellerAllowList(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string]>;
|
||||
): Promise<[string] & { root: string }>;
|
||||
|
||||
sellerBalance(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
): Promise<[BigNumber] & { packed: BigNumber }>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
@ -716,9 +704,9 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
): Promise<[boolean] & { used: boolean }>;
|
||||
|
||||
userRecord(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
@ -726,9 +714,9 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
validBacenSigners(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
): Promise<[boolean] & { valid: boolean }>;
|
||||
|
||||
withdraw(
|
||||
token: PromiseOrValue<string>,
|
||||
@ -742,8 +730,6 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@ -755,7 +741,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
arg0: PromiseOrValue<string>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -803,7 +789,6 @@ export interface P2PIX extends BaseContract {
|
||||
_seller: PromiseOrValue<string>,
|
||||
_token: PromiseOrValue<string>,
|
||||
_buyerAddress: PromiseOrValue<string>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
@ -826,17 +811,15 @@ export interface P2PIX extends BaseContract {
|
||||
BigNumber,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerTarget: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
}
|
||||
@ -846,7 +829,6 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
@ -857,13 +839,13 @@ export interface P2PIX extends BaseContract {
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
sellerBalance(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -911,7 +893,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -921,7 +903,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -937,8 +919,6 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@ -950,7 +930,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
arg0: PromiseOrValue<string>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -998,7 +978,6 @@ export interface P2PIX extends BaseContract {
|
||||
_seller: PromiseOrValue<string>,
|
||||
_token: PromiseOrValue<string>,
|
||||
_buyerAddress: PromiseOrValue<string>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
@ -1021,17 +1000,15 @@ export interface P2PIX extends BaseContract {
|
||||
BigNumber,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string
|
||||
] & {
|
||||
sellerKey: BigNumber;
|
||||
counter: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
relayerPremium: BigNumber;
|
||||
amount: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerTarget: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
}
|
||||
@ -1041,7 +1018,6 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
@ -1052,13 +1028,13 @@ export interface P2PIX extends BaseContract {
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
sellerBalance(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -1106,7 +1082,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<void>;
|
||||
|
||||
usedTransactions(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -1116,7 +1092,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -1219,10 +1195,13 @@ export interface P2PIX extends BaseContract {
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: null,
|
||||
merkleRoot?: null
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(seller?: null, merkleRoot?: null): RootUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
@ -1242,8 +1221,6 @@ export interface P2PIX extends BaseContract {
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
WAD(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@ -1255,7 +1232,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
allowedERC20s(
|
||||
arg0: PromiseOrValue<string>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -1303,7 +1280,6 @@ export interface P2PIX extends BaseContract {
|
||||
_seller: PromiseOrValue<string>,
|
||||
_token: PromiseOrValue<string>,
|
||||
_buyerAddress: PromiseOrValue<string>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
@ -1322,7 +1298,6 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
@ -1333,13 +1308,13 @@ export interface P2PIX extends BaseContract {
|
||||
reputation(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
sellerAllowList(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
sellerBalance(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -1387,7 +1362,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
usedTransactions(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -1397,7 +1372,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -1414,8 +1389,6 @@ export interface P2PIX extends BaseContract {
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
WAD(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
@ -1427,7 +1400,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
allowedERC20s(
|
||||
arg0: PromiseOrValue<string>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
@ -1475,7 +1448,6 @@ export interface P2PIX extends BaseContract {
|
||||
_seller: PromiseOrValue<string>,
|
||||
_token: PromiseOrValue<string>,
|
||||
_buyerAddress: PromiseOrValue<string>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
||||
_amount: PromiseOrValue<BigNumberish>,
|
||||
merkleProof: PromiseOrValue<BytesLike>[],
|
||||
@ -1494,7 +1466,6 @@ export interface P2PIX extends BaseContract {
|
||||
|
||||
release(
|
||||
lockID: PromiseOrValue<BigNumberish>,
|
||||
_relayerTarget: PromiseOrValue<string>,
|
||||
pixTimestamp: PromiseOrValue<BytesLike>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
@ -1505,13 +1476,13 @@ export interface P2PIX extends BaseContract {
|
||||
reputation(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerAllowList(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerBalance(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
@ -1559,7 +1530,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
arg0: PromiseOrValue<BytesLike>,
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
@ -1569,7 +1540,7 @@ export interface P2PIX extends BaseContract {
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
arg0: PromiseOrValue<BigNumberish>,
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
|
@ -179,7 +179,7 @@ describe("P2PIX", () => {
|
||||
|
||||
await expect(
|
||||
p2pix.connect(acc01).withdrawBalance(),
|
||||
).to.be.revertedWith(P2PixErrors.UNAUTHORIZED);
|
||||
).to.be.revertedWithCustomError(p2pix, P2PixErrors.Unauthorized);
|
||||
});
|
||||
it("should allow owner to change reputation instance", async () => {
|
||||
const tx = await p2pix.setReputation(acc03.address);
|
||||
@ -193,8 +193,9 @@ describe("P2PIX", () => {
|
||||
.to.emit(p2pix, "ReputationUpdated")
|
||||
.withArgs(acc03.address);
|
||||
expect(newRep).to.eq(acc03.address);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to change defaultLockBlocks ", async () => {
|
||||
@ -211,8 +212,9 @@ describe("P2PIX", () => {
|
||||
.to.emit(p2pix, "LockBlocksUpdated")
|
||||
.withArgs(magicVal);
|
||||
expect(newVal).to.eq(magicVal);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to add valid Bacen signers", async () => {
|
||||
@ -236,8 +238,9 @@ describe("P2PIX", () => {
|
||||
await expect(tx)
|
||||
.to.emit(p2pix, "ValidSignersUpdated")
|
||||
.withArgs([bob, alice]);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to adjust tokenSettings", async () => {
|
||||
@ -274,11 +277,13 @@ describe("P2PIX", () => {
|
||||
.withArgs(owner.address, true);
|
||||
expect(newTokenState1).to.eq(false);
|
||||
expect(newTokenState2).to.eq(true);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
await expect(fail2).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
@ -293,7 +298,6 @@ describe("P2PIX", () => {
|
||||
multicall,
|
||||
P2PixErrors.CallFailed,
|
||||
)
|
||||
.withArgs(P2PixErrors.UNAUTHORIZED);
|
||||
});
|
||||
});
|
||||
describe("Deposit", async () => {
|
||||
@ -622,7 +626,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price,
|
||||
[],
|
||||
@ -632,7 +635,6 @@ describe("P2PIX", () => {
|
||||
zero,
|
||||
zero,
|
||||
zero,
|
||||
zero,
|
||||
0,
|
||||
price,
|
||||
[],
|
||||
@ -664,7 +666,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price.mul(ethers.BigNumber.from(2)),
|
||||
[],
|
||||
@ -692,7 +693,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
1000,
|
||||
[
|
||||
@ -726,7 +726,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price.mul(BigNumber.from("2")),
|
||||
[],
|
||||
@ -754,7 +753,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price,
|
||||
proof,
|
||||
@ -788,7 +786,6 @@ describe("P2PIX", () => {
|
||||
expect(storage.expirationBlock).to.eq(expiration);
|
||||
expect(storage.pixTarget).to.eq(target);
|
||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
||||
expect(storage.relayerTarget).to.eq(acc03.address);
|
||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
||||
expect(storage.token).to.eq(erc20.address);
|
||||
});
|
||||
@ -809,7 +806,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price,
|
||||
[],
|
||||
@ -839,7 +835,6 @@ describe("P2PIX", () => {
|
||||
expect(storage.expirationBlock).to.eq(expiration);
|
||||
expect(storage.pixTarget).to.eq(target);
|
||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
||||
expect(storage.relayerTarget).to.eq(acc03.address);
|
||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
||||
expect(storage.token).to.eq(erc20.address);
|
||||
|
||||
@ -855,7 +850,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, price, endtoendID],
|
||||
);
|
||||
const messageHashBytes =
|
||||
@ -878,7 +873,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
price,
|
||||
price,
|
||||
[],
|
||||
@ -888,7 +882,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
1,
|
||||
acc02.address,
|
||||
endtoendID,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -900,7 +893,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price.add(ethers.constants.One),
|
||||
[],
|
||||
@ -932,7 +924,6 @@ describe("P2PIX", () => {
|
||||
expect(storage.expirationBlock).to.eq(expiration);
|
||||
expect(storage.pixTarget).to.eq(target);
|
||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
||||
expect(storage.relayerTarget).to.eq(acc03.address);
|
||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
||||
expect(storage.token).to.eq(erc20.address);
|
||||
|
||||
@ -958,7 +949,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
newPrice,
|
||||
proof,
|
||||
@ -977,7 +967,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
100,
|
||||
[],
|
||||
@ -996,7 +985,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc03.address,
|
||||
acc03.address,
|
||||
0,
|
||||
100,
|
||||
[],
|
||||
@ -1110,10 +1098,10 @@ describe("P2PIX", () => {
|
||||
.and.to.eq(storage2.buyerAddress);
|
||||
expect(storage3.buyerAddress).to.eq(acc03.address);
|
||||
|
||||
expect(acc03.address)
|
||||
.to.eq(storage1.relayerTarget)
|
||||
.and.to.eq(storage2.relayerTarget)
|
||||
.and.to.eq(storage3.relayerTarget);
|
||||
// expect(acc03.address)
|
||||
// .to.eq(storage1.relayerTarget)
|
||||
// .and.to.eq(storage2.relayerTarget)
|
||||
// .and.to.eq(storage3.relayerTarget);
|
||||
|
||||
expect(acc01.address)
|
||||
.to.eq(storage1.relayerAddress)
|
||||
@ -1269,7 +1257,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if lock has expired", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await acc01.signMessage(
|
||||
@ -1290,7 +1278,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1300,7 +1287,6 @@ describe("P2PIX", () => {
|
||||
await mine(13);
|
||||
const fail = p2pix.release(
|
||||
lockID,
|
||||
acc03.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1316,7 +1302,7 @@ describe("P2PIX", () => {
|
||||
const target = ethers.BigNumber.from("1");
|
||||
const hashZero = ethers.constants.HashZero;
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, hashZero],
|
||||
);
|
||||
const flatSig = await acc01.signMessage(
|
||||
@ -1337,7 +1323,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1346,7 +1331,6 @@ describe("P2PIX", () => {
|
||||
const lockID = ethers.constants.One;
|
||||
await p2pix.release(
|
||||
lockID,
|
||||
acc03.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1354,7 +1338,6 @@ describe("P2PIX", () => {
|
||||
);
|
||||
const fail = p2pix.release(
|
||||
lockID,
|
||||
acc03.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1369,7 +1352,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if signed message has already been used", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await owner.signMessage(
|
||||
@ -1390,7 +1373,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1401,7 +1383,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
1,
|
||||
acc02.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1413,7 +1394,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1423,7 +1403,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
2,
|
||||
acc02.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1438,7 +1417,7 @@ describe("P2PIX", () => {
|
||||
it("should revert if ecrecovered signer is invalid", async () => {
|
||||
const target = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[target, 100, ethers.constants.HashZero],
|
||||
);
|
||||
const flatSig = await acc03.signMessage(
|
||||
@ -1460,7 +1439,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1470,7 +1448,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
1,
|
||||
acc02.address,
|
||||
ethers.constants.HashZero,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1487,7 +1464,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const pixTarget = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 100, endtoendID],
|
||||
);
|
||||
// Note: messageToSign is a string, that is 66-bytes long, to sign the
|
||||
@ -1522,7 +1499,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
100,
|
||||
[],
|
||||
@ -1547,7 +1523,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
1,
|
||||
acc02.address,
|
||||
endtoendID,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1633,8 +1608,8 @@ describe("P2PIX", () => {
|
||||
expect(userRecord2).to.eq(ethers.BigNumber.from(100));
|
||||
await expect(tx).to.changeTokenBalances(
|
||||
erc20,
|
||||
[acc03.address, acc02.address],
|
||||
[3, 97],
|
||||
[acc03.address, acc01.address, acc02.address ],
|
||||
[3, 3, 94],
|
||||
// acc02 is acting both as buyer and relayerTarget
|
||||
// (i.e., 94 + 3 = 97)
|
||||
);
|
||||
@ -1657,7 +1632,7 @@ describe("P2PIX", () => {
|
||||
acc03Key,
|
||||
);
|
||||
const messageToSign1 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 100, endtoendID],
|
||||
);
|
||||
const flatSig1 = await owner.signMessage(
|
||||
@ -1665,7 +1640,7 @@ describe("P2PIX", () => {
|
||||
);
|
||||
const sig1 = ethers.utils.splitSignature(flatSig1);
|
||||
const messageToSign2 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 50, endtoendID],
|
||||
);
|
||||
const flatSig2 = await owner.signMessage(
|
||||
@ -1673,7 +1648,7 @@ describe("P2PIX", () => {
|
||||
);
|
||||
const sig2 = ethers.utils.splitSignature(flatSig2);
|
||||
const messageToSign3 = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 25, endtoendID],
|
||||
);
|
||||
const flatSig3 = await owner.signMessage(
|
||||
@ -1694,7 +1669,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
100,
|
||||
[],
|
||||
@ -1706,7 +1680,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
6,
|
||||
50,
|
||||
[],
|
||||
@ -1718,7 +1691,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
10,
|
||||
25,
|
||||
[],
|
||||
@ -1754,7 +1726,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
lockID,
|
||||
acc02.address,
|
||||
endtoendID,
|
||||
sig1.r,
|
||||
sig1.s,
|
||||
@ -1766,7 +1737,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc01)
|
||||
.release(
|
||||
lockID2,
|
||||
acc02.address,
|
||||
endtoendID,
|
||||
sig2.r,
|
||||
sig2.s,
|
||||
@ -1778,7 +1748,6 @@ describe("P2PIX", () => {
|
||||
.connect(acc03)
|
||||
.release(
|
||||
lockID3,
|
||||
acc02.address,
|
||||
endtoendID,
|
||||
sig3.r,
|
||||
sig3.s,
|
||||
@ -1849,8 +1818,8 @@ describe("P2PIX", () => {
|
||||
|
||||
const balances = [
|
||||
[0, 100, 0, "-100"],
|
||||
[0, 47, 3, "-50"],
|
||||
[0, 20, 5, "-25"],
|
||||
[3, 44, 3, "-50"],
|
||||
[0, 15, 10, "-25"],
|
||||
];
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
@ -1899,7 +1868,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
1,
|
||||
[],
|
||||
@ -1917,7 +1885,7 @@ describe("P2PIX", () => {
|
||||
const endtoendID = ethers.constants.HashZero;
|
||||
const pixTarget = ethers.BigNumber.from(101);
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["uint160", "uint80", "bytes32"],
|
||||
[pixTarget, 1, endtoendID],
|
||||
);
|
||||
const messageHashBytes =
|
||||
@ -1940,7 +1908,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
1,
|
||||
[],
|
||||
@ -1950,7 +1917,6 @@ describe("P2PIX", () => {
|
||||
// await mine(10);
|
||||
await p2pix.release(
|
||||
lockID,
|
||||
acc03.address,
|
||||
endtoendID,
|
||||
sig.r,
|
||||
sig.s,
|
||||
@ -1979,7 +1945,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
1,
|
||||
[],
|
||||
@ -2045,7 +2010,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price,
|
||||
proof,
|
||||
@ -2087,7 +2051,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
100,
|
||||
[],
|
||||
@ -2123,7 +2086,6 @@ describe("P2PIX", () => {
|
||||
owner.address,
|
||||
erc20.address,
|
||||
acc02.address,
|
||||
acc03.address,
|
||||
0,
|
||||
price,
|
||||
proof,
|
||||
|
@ -1,5 +1,4 @@
|
||||
export enum P2PixErrors {
|
||||
DepositAlreadyExists = "DepositAlreadyExists",
|
||||
OnlySeller = "OnlySeller",
|
||||
NotExpired = "NotExpired",
|
||||
LoopOverflow = "LoopOverflow",
|
||||
@ -8,7 +7,7 @@ export enum P2PixErrors {
|
||||
AlreadyReleased = "AlreadyReleased",
|
||||
TxAlreadyUsed = "TxAlreadyUsed",
|
||||
InvalidSigner = "InvalidSigner",
|
||||
UNAUTHORIZED = "UNAUTHORIZED",
|
||||
Unauthorized = "Unauthorized",
|
||||
TokenDenied = "TokenDenied",
|
||||
NoTokens = "NoTokens",
|
||||
LengthMismatch = "LengthMismatch",
|
||||
|
@ -27,7 +27,6 @@ export interface Lock {
|
||||
expirationBlock: BigNumber;
|
||||
pixTarget: BigNumber;
|
||||
buyerAddress: string;
|
||||
relayerTarget: string;
|
||||
relayerAddress: string;
|
||||
token: string;
|
||||
}
|
||||
|
34
yarn.lock
34
yarn.lock
@ -409,6 +409,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@colors/colors@npm:1.5.0":
|
||||
version: 1.5.0
|
||||
resolution: "@colors/colors@npm:1.5.0"
|
||||
checksum: d64d5260bed1d5012ae3fc617d38d1afc0329fec05342f4e6b838f46998855ba56e0a73833f4a80fa8378c84810da254f76a8a19c39d038260dc06dc4e007425
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@commitlint/cli@npm:^17.2.0":
|
||||
version: 17.2.0
|
||||
resolution: "@commitlint/cli@npm:17.2.0"
|
||||
@ -3688,6 +3695,19 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cli-table3@npm:^0.6.0":
|
||||
version: 0.6.3
|
||||
resolution: "cli-table3@npm:0.6.3"
|
||||
dependencies:
|
||||
"@colors/colors": 1.5.0
|
||||
string-width: ^4.2.0
|
||||
dependenciesMeta:
|
||||
"@colors/colors":
|
||||
optional: true
|
||||
checksum: 09897f68467973f827c04e7eaadf13b55f8aec49ecd6647cc276386ea660059322e2dd8020a8b6b84d422dbdd619597046fa89cbbbdc95b2cea149a2df7c096c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cli-truncate@npm:^2.1.0":
|
||||
version: 2.1.0
|
||||
resolution: "cli-truncate@npm:2.1.0"
|
||||
@ -6036,6 +6056,19 @@ fsevents@~2.1.1:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hardhat-contract-sizer@npm:^2.8.0":
|
||||
version: 2.8.0
|
||||
resolution: "hardhat-contract-sizer@npm:2.8.0"
|
||||
dependencies:
|
||||
chalk: ^4.0.0
|
||||
cli-table3: ^0.6.0
|
||||
strip-ansi: ^6.0.0
|
||||
peerDependencies:
|
||||
hardhat: ^2.0.0
|
||||
checksum: 6f1f4aca16a8ceeb9b3ce8ec89075c2fb292a3c82941ae826a9d503e077fda58e1d62b5c561252385c320a978d65399a2e829cec7c643250eaca163546831cbb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hardhat-gas-reporter@npm:^1.0.9":
|
||||
version: 1.0.9
|
||||
resolution: "hardhat-gas-reporter@npm:1.0.9"
|
||||
@ -8459,6 +8492,7 @@ fsevents@~2.1.1:
|
||||
ethers: ^5.7.2
|
||||
fs-extra: ^10.1.0
|
||||
hardhat: ^2.12.2
|
||||
hardhat-contract-sizer: ^2.8.0
|
||||
hardhat-gas-reporter: ^1.0.9
|
||||
hardhat-tracer: beta
|
||||
husky: ^8.0.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user