Compare commits
1 Commits
4b129e2632
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4568cad8f0 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -5,8 +5,7 @@
|
||||
!.yarn/plugins
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
artifacts
|
||||
**/artifacts
|
||||
# **/artifacts
|
||||
artifacts/build-info
|
||||
**/build
|
||||
**/ref
|
||||
@@ -17,8 +16,6 @@ artifacts/build-info
|
||||
**/.coverage_contracts
|
||||
**/dist
|
||||
**/node_modules
|
||||
.deps
|
||||
src/types
|
||||
|
||||
# files
|
||||
*.env
|
||||
|
||||
13
.solcover.js
13
.solcover.js
@@ -1,18 +1,7 @@
|
||||
module.exports = {
|
||||
configureYulOptimizer: true,
|
||||
solcOptimizerDetails: {
|
||||
deduplicate: true,
|
||||
cse: true,
|
||||
constantOptimizer: true,
|
||||
peephole: true,
|
||||
jumpdestRemover: true,
|
||||
yul: true,
|
||||
// inliner: false,
|
||||
// orderLiterals: true,
|
||||
},
|
||||
istanbulReporter: ["html", "lcov"],
|
||||
providerOptions: {
|
||||
mnemonic: process.env.MNEMONIC,
|
||||
},
|
||||
skipFiles: ["test", 'core/BaseUtils.sol', 'core/OwnerSettings.sol'],
|
||||
skipFiles: ["test"],
|
||||
};
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
```rs
|
||||
./contracts/
|
||||
├── Constants.sol
|
||||
├── DataTypes.sol
|
||||
├── EventAndErrors.sol
|
||||
├── lib
|
||||
@@ -19,9 +18,7 @@
|
||||
│ ├── tokens
|
||||
│ │ └── ERC20.sol
|
||||
│ └── utils
|
||||
│ ├── ECDSA.sol
|
||||
│ ├── MerkleProofLib.sol
|
||||
│ ├── Multicall.sol
|
||||
│ ├── ReentrancyGuard.sol
|
||||
│ └── SafeTransferLib.sol
|
||||
├── p2pix.sol
|
||||
|
||||
4
artifacts/contracts/DataTypes.sol/DataTypes.dbg.json
Normal file
4
artifacts/contracts/DataTypes.sol/DataTypes.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
10
artifacts/contracts/DataTypes.sol/DataTypes.json
Normal file
10
artifacts/contracts/DataTypes.sol/DataTypes.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "DataTypes",
|
||||
"sourceName": "contracts/DataTypes.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
357
artifacts/contracts/EventAndErrors.sol/EventAndErrors.json
Normal file
357
artifacts/contracts/EventAndErrors.sol/EventAndErrors.json
Normal file
@@ -0,0 +1,357 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "EventAndErrors",
|
||||
"sourceName": "contracts/EventAndErrors.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AddressDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AmountNotAllowed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DepositAlreadyExists",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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": "address",
|
||||
"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": "address",
|
||||
"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": false,
|
||||
"internalType": "address",
|
||||
"name": "reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
4
artifacts/contracts/Reputation.sol/Reputation.dbg.json
Normal file
4
artifacts/contracts/Reputation.sol/Reputation.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
106
artifacts/contracts/Reputation.sol/Reputation.json
Normal file
106
artifacts/contracts/Reputation.sol/Reputation.json
Normal file
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Reputation",
|
||||
"sourceName": "contracts/Reputation.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"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": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_userCredit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "limiter",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_spendLimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "magicValue",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "maxLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"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",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
4
artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json
Normal file
4
artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
56
artifacts/contracts/lib/auth/Owned.sol/Owned.json
Normal file
56
artifacts/contracts/lib/auth/Owned.sol/Owned.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Owned",
|
||||
"sourceName": "contracts/lib/auth/Owned.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"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": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IReputation",
|
||||
"sourceName": "contracts/lib/interfaces/IReputation.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_userCredit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "limiter",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_spendLimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
337
artifacts/contracts/lib/mock/mockToken.sol/MockToken.json
Normal file
337
artifacts/contracts/lib/mock/mockToken.sol/MockToken.json
Normal file
File diff suppressed because one or more lines are too long
4
artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json
Normal file
4
artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
308
artifacts/contracts/lib/tokens/ERC20.sol/ERC20.json
Normal file
308
artifacts/contracts/lib/tokens/ERC20.sol/ERC20.json
Normal file
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ERC20",
|
||||
"sourceName": "contracts/lib/tokens/ERC20.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DOMAIN_SEPARATOR",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nonces",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "deadline",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint8",
|
||||
"name": "v",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "r",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "s",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "permit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "MerkleProofLib",
|
||||
"sourceName": "contracts/lib/utils/MerkleProofLib.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
116
artifacts/contracts/lib/utils/Multicall.sol/Multicall.json
Normal file
116
artifacts/contracts/lib/utils/Multicall.sol/Multicall.json
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Multicall",
|
||||
"sourceName": "contracts/lib/utils/Multicall.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "reason",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"name": "CallFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "mtc1",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes[]",
|
||||
"name": "",
|
||||
"type": "bytes[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "mtc2",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall.Result[]",
|
||||
"name": "",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60806040526108ec806100136000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ReentrancyGuard",
|
||||
"sourceName": "contracts/lib/utils/ReentrancyGuard.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Reentrancy",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "SafeTransferLib",
|
||||
"sourceName": "contracts/lib/utils/SafeTransferLib.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x602d6037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000809000a",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
4
artifacts/contracts/p2pix.sol/P2PIX.dbg.json
Normal file
4
artifacts/contracts/p2pix.sol/P2PIX.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json"
|
||||
}
|
||||
1096
artifacts/contracts/p2pix.sol/P2PIX.json
Normal file
1096
artifacts/contracts/p2pix.sol/P2PIX.json
Normal file
File diff suppressed because one or more lines are too long
32
contracts/DataTypes.sol
Normal file
32
contracts/DataTypes.sol
Normal file
@@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.9;
|
||||
|
||||
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 Where the tokens are sent the when order gets validated.
|
||||
address buyerAddress;
|
||||
/// @dev Relayer's target address that receives `relayerPremium` funds.
|
||||
address relayerTarget;
|
||||
/// @dev Relayer address (msg.sender) that facilitated this transaction.
|
||||
/// @dev Reputation points accruer.
|
||||
address relayerAddress;
|
||||
address token;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
enum LockStatus {
|
||||
Inexistent, // 0 := Uninitialized Lock.
|
||||
Active, // 1 := Valid Lock.
|
||||
Expired, // 2 := Expired Lock.
|
||||
Released // 3 := Already released Lock.
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,62 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "contracts/lib/tokens/ERC20.sol";
|
||||
pragma solidity 0.8.9;
|
||||
|
||||
// prettier-ignore
|
||||
interface EventAndErrors {
|
||||
/// ███ Events ████████████████████████████████████████████████████████████
|
||||
|
||||
/// @dev 0x63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf
|
||||
event DepositAdded(
|
||||
address indexed seller,
|
||||
// uint256 depositID,
|
||||
ERC20 token,
|
||||
address token,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0xca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d49
|
||||
event ValidSet(
|
||||
address indexed seller,
|
||||
ERC20 token,
|
||||
address token,
|
||||
bool state
|
||||
);
|
||||
/// @dev 0x2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e
|
||||
event DepositWithdrawn(
|
||||
address indexed seller,
|
||||
ERC20 token,
|
||||
address token,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65
|
||||
event LockAdded(
|
||||
address indexed buyer,
|
||||
uint256 indexed lockID,
|
||||
address seller,
|
||||
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 indexed seller,
|
||||
bytes32 indexed merkleRoot
|
||||
address seller,
|
||||
bytes32 merkleRoot
|
||||
);
|
||||
/// @dev 0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a
|
||||
event AllowedERC20Updated(
|
||||
address indexed token,
|
||||
bool indexed state
|
||||
);
|
||||
/// @dev 0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92
|
||||
event TrustedForwarderUpdated(
|
||||
address indexed forwarder,
|
||||
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
|
||||
@@ -122,6 +105,7 @@ interface EventAndErrors {
|
||||
/// @dev Reverts on an expired lock.
|
||||
/// @dev 0xf6fafba0
|
||||
error LockExpired();
|
||||
|
||||
/// @dev 0xce3a3d37
|
||||
error DecOverflow();
|
||||
/// @dev 0xf3fb0eb9
|
||||
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
pragma solidity 0.8.9;
|
||||
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
import { Owned } from "./lib/auth/Owned.sol";
|
||||
|
||||
contract Reputation is IReputation {
|
||||
contract Reputation is IReputation, Owned(msg.sender) {
|
||||
/// @dev Asymptote numerator constant value for the `limiter` fx.
|
||||
uint256 public constant maxLimit = 1e6;
|
||||
/// @dev Denominator's constant operand for the `limiter` fx.
|
||||
@@ -12,7 +13,7 @@ contract Reputation is IReputation {
|
||||
// prettier-ignore
|
||||
// solhint-disable no-inline-assembly
|
||||
// solhint-disable-next-line no-empty-blocks
|
||||
constructor(/* */) payable {/* */}
|
||||
constructor(/* */) {/* */}
|
||||
|
||||
function limiter(
|
||||
uint256 _userCredit
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20, OwnerSettings } from "contracts/core/OwnerSettings.sol";
|
||||
|
||||
import { ECDSA } from "contracts/lib/utils/ECDSA.sol";
|
||||
import { MerkleProofLib as Merkle } from "contracts/lib/utils/MerkleProofLib.sol";
|
||||
import { ReentrancyGuard } from "contracts/lib/utils/ReentrancyGuard.sol";
|
||||
|
||||
abstract contract BaseUtils is
|
||||
OwnerSettings,
|
||||
ReentrancyGuard
|
||||
{
|
||||
/// ███ 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 ("memory-safe") {
|
||||
sstore(message, true)
|
||||
}
|
||||
}
|
||||
|
||||
function usedTransactions(
|
||||
bytes32 message
|
||||
) public view returns (bool used) {
|
||||
assembly ("memory-safe") {
|
||||
used := sload(message)
|
||||
}
|
||||
}
|
||||
|
||||
function _signerCheck(
|
||||
bytes32 _message,
|
||||
bytes calldata _signature
|
||||
) internal view {
|
||||
if (usedTransactions(_message))
|
||||
revert TxAlreadyUsed();
|
||||
|
||||
if (
|
||||
!validBacenSigners(
|
||||
_castAddrToKey(
|
||||
ECDSA.recoverCalldata(
|
||||
ECDSA.toEthSignedMessageHash(
|
||||
_message
|
||||
),
|
||||
_signature
|
||||
)
|
||||
)
|
||||
)
|
||||
) 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 _castBool(
|
||||
bool _valid
|
||||
) internal pure returns (uint256 _validCasted) {
|
||||
assembly ("memory-safe") {
|
||||
_validCasted := _valid
|
||||
}
|
||||
}
|
||||
|
||||
function getStr(
|
||||
string memory str
|
||||
) public pure returns (bytes32 strEnc) {
|
||||
bytes memory enc = bytes(abi.encodePacked(str));
|
||||
assembly ("memory-safe") {
|
||||
if lt(0x20, mload(enc)) {
|
||||
invalid()
|
||||
}
|
||||
strEnc := mload(add(enc, 0x20))
|
||||
}
|
||||
}
|
||||
|
||||
function _setSellerBalance(
|
||||
address _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _packed,
|
||||
bytes32 _pixTarget
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
let _loc := keccak256(0x0c, 0x34)
|
||||
sstore(add(_loc, 0x01), _packed)
|
||||
sstore(_loc, _pixTarget)
|
||||
}
|
||||
}
|
||||
|
||||
function _setValidState(
|
||||
address _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _packed
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
let _loc := keccak256(0x0c, 0x34)
|
||||
sstore(add(_loc, 0x01), _packed)
|
||||
}
|
||||
}
|
||||
|
||||
function _addSellerBalance(
|
||||
address _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _amount
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
let _loc := add(keccak256(0x0c, 0x34), 0x01)
|
||||
sstore(_loc, add(sload(_loc), _amount))
|
||||
}
|
||||
}
|
||||
|
||||
function _decSellerBalance(
|
||||
address _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _amount
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
let _loc := add(keccak256(0x0c, 0x34), 0x01)
|
||||
sstore(_loc, sub(sload(_loc), _amount))
|
||||
}
|
||||
}
|
||||
|
||||
function __sellerBalance(
|
||||
address _sellerKey,
|
||||
ERC20 _erc20
|
||||
) internal view returns (uint256 _packed) {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
_packed := sload(add(keccak256(0x0c, 0x34), 0x01))
|
||||
}
|
||||
}
|
||||
|
||||
/// @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 ("memory-safe") {
|
||||
_key := shl(0xc, _addr)
|
||||
}
|
||||
}
|
||||
|
||||
function _castKeyToAddr(
|
||||
uint256 _key
|
||||
) public pure returns (address _addr) {
|
||||
// _addr = address(uint160(uint256(_key >> 12)));
|
||||
assembly ("memory-safe") {
|
||||
_addr := shr(0xc, _key)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
// 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;
|
||||
uint256 constant _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE =
|
||||
0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92;
|
||||
|
||||
/// @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`, `uint96` } )) public sellerBalance;
|
||||
|
||||
/// @dev Bits layout:
|
||||
/// `bytes32` [0...255] := pixTarget
|
||||
/// `uint96` [0...94] := balance
|
||||
/// `bool` [95] := 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 `valid` in `sellerBalance`.
|
||||
uint256 constant BITPOS_VALID = 95;
|
||||
|
||||
/// @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 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "contracts/lib/tokens/ERC20.sol";
|
||||
|
||||
library DataTypes {
|
||||
|
||||
struct Lock {
|
||||
uint256 counter;
|
||||
uint256 expirationBlock;
|
||||
bytes32 pixTarget;
|
||||
uint80 amount;
|
||||
ERC20 token;
|
||||
address buyerAddress;
|
||||
address seller;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
enum LockStatus {
|
||||
Inexistent, // 0 := Uninitialized Lock.
|
||||
Active, // 1 := Valid Lock.
|
||||
Expired, // 2 := Expired Lock.
|
||||
Released // 3 := Already released Lock.
|
||||
}
|
||||
}
|
||||
@@ -1,241 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC2771Context as ERC2771 } from "contracts/lib/metatx/ERC2771Context.sol";
|
||||
import { ERC20, SafeTransferLib } from "contracts/lib/utils/SafeTransferLib.sol";
|
||||
import { IReputation } from "contracts/lib/interfaces/IReputation.sol";
|
||||
import { EventAndErrors } from "contracts/core/EventAndErrors.sol";
|
||||
import { Constants } from "contracts/core/Constants.sol";
|
||||
import { Owned } from "contracts/lib/auth/Owned.sol";
|
||||
|
||||
abstract contract OwnerSettings is
|
||||
Constants,
|
||||
EventAndErrors,
|
||||
Owned(msg.sender),
|
||||
ERC2771
|
||||
{
|
||||
/// ███ 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 █████████████████████████████████████████████████████████
|
||||
|
||||
function setTrustedFowarders(
|
||||
address[] memory forwarders,
|
||||
bool[] memory states
|
||||
) external onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
// first 32 bytes eq to array's length
|
||||
let fLen := mload(forwarders)
|
||||
// halts execution if forwarders.length eq 0
|
||||
if iszero(fLen) {
|
||||
invalid()
|
||||
}
|
||||
// revert with `LengthMismatch()`
|
||||
if iszero(eq(fLen, mload(states))) {
|
||||
mstore(0x00, 0xff633a38)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
let fLoc := add(forwarders, 0x20)
|
||||
let sLoc := add(states, 0x20)
|
||||
for {
|
||||
let end := add(fLoc, shl(5, fLen))
|
||||
} iszero(eq(fLoc, end)) {
|
||||
fLoc := add(fLoc, 0x20)
|
||||
sLoc := add(sLoc, 0x20)
|
||||
} {
|
||||
// cache hashmap entry in scratch space
|
||||
mstore(0x20, trustedForwarders.slot)
|
||||
mstore(0x00, mload(fLoc))
|
||||
// let mapSlot := keccak256(0x00, 0x40)
|
||||
sstore(keccak256(0x00, 0x40), mload(sLoc))
|
||||
|
||||
// emit TrustedForwarderUpdated(address, bool)
|
||||
log3(
|
||||
0,
|
||||
0,
|
||||
_TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE,
|
||||
mload(fLoc),
|
||||
mload(sLoc)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Contract's underlying balance withdraw method.
|
||||
/// @dev Function sighash: 0x5fd8c710.
|
||||
function withdrawBalance() external onlyOwner {
|
||||
uint256 balance = address(this).balance;
|
||||
SafeTransferLib.safeTransferETH(msg.sender, balance);
|
||||
emit FundsWithdrawn(msg.sender, balance);
|
||||
}
|
||||
|
||||
function setReputation(
|
||||
IReputation _reputation
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
sstore(reputation.slot, _reputation)
|
||||
}
|
||||
emit ReputationUpdated(address(_reputation));
|
||||
}
|
||||
|
||||
function setDefaultLockBlocks(
|
||||
uint256 _blocks
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
sstore(defaultLockBlocks.slot, _blocks)
|
||||
}
|
||||
emit LockBlocksUpdated(_blocks);
|
||||
}
|
||||
|
||||
function setValidSigners(
|
||||
address[] memory _validSigners
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
let i := add(_validSigners, 0x20)
|
||||
let end := add(i, shl(0x05, mload(_validSigners)))
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
sstore(shl(0xc, 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 ("memory-safe") {
|
||||
// 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 ("memory-safe") {
|
||||
valid := sload(signer)
|
||||
}
|
||||
}
|
||||
|
||||
function sellerAllowList(
|
||||
address sellerKey
|
||||
) public view returns (bytes32 root) {
|
||||
assembly ("memory-safe") {
|
||||
mstore(0x0c, _SELLER_ALLOWLIST_SLOT_SEED)
|
||||
mstore(0x00, sellerKey)
|
||||
root := sload(keccak256(0x00, 0x20))
|
||||
}
|
||||
}
|
||||
|
||||
function allowedERC20s(
|
||||
ERC20 erc20
|
||||
) public view returns (bool state) {
|
||||
assembly ("memory-safe") {
|
||||
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 ("memory-safe") {
|
||||
success := staticcall(
|
||||
// gas
|
||||
gas(),
|
||||
// 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,8 +4,6 @@ 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
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
@@ -22,7 +20,7 @@ abstract contract Owned {
|
||||
address public owner;
|
||||
|
||||
modifier onlyOwner() virtual {
|
||||
if (msg.sender != owner) revert Unauthorized();
|
||||
require(msg.sender == owner, "UNAUTHORIZED");
|
||||
|
||||
_;
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity >=0.8.4;
|
||||
|
||||
/// @author OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
|
||||
/// (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol)
|
||||
|
||||
/// @dev Provides information about the current execution context, including the
|
||||
/// sender of the transaction and its data. While these are generally available
|
||||
/// via msg.sender and msg.data, they should not be accessed in such a direct
|
||||
/// manner, since when dealing with meta-transactions the account sending and
|
||||
/// paying for execution may not be the actual sender (as far as an application
|
||||
/// is concerned).
|
||||
///
|
||||
/// This contract is only required for intermediate, library-like contracts.
|
||||
abstract contract Context {
|
||||
function _msgSender()
|
||||
internal
|
||||
view
|
||||
virtual
|
||||
returns (address)
|
||||
{
|
||||
return msg.sender;
|
||||
}
|
||||
|
||||
function _msgData()
|
||||
internal
|
||||
view
|
||||
virtual
|
||||
returns (bytes calldata)
|
||||
{
|
||||
return msg.data;
|
||||
}
|
||||
}
|
||||
|
||||
/// @author Modified from OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)
|
||||
/// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/ERC2771Context.sol
|
||||
|
||||
/// @dev Context variant with ERC2771 support.
|
||||
abstract contract ERC2771Context is Context {
|
||||
// address private immutable _trustedForwarder;
|
||||
mapping(address => bool) public trustedForwarders;
|
||||
|
||||
/// @custom:oz-upgrades-unsafe-allow constructor
|
||||
// constructor(address trustedForwarder) {
|
||||
// _trustedForwarder = trustedForwarder;
|
||||
// }
|
||||
|
||||
function _msgSender()
|
||||
internal
|
||||
view
|
||||
virtual
|
||||
override
|
||||
returns (address sender)
|
||||
{
|
||||
if (trustedForwarders[msg.sender]) {
|
||||
// The assembly code is more direct than the Solidity version using `abi.decode`.
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
sender := shr(
|
||||
96,
|
||||
calldataload(sub(calldatasize(), 20))
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return super._msgSender();
|
||||
}
|
||||
}
|
||||
|
||||
function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
|
||||
return trustedForwarders[forwarder];
|
||||
}
|
||||
|
||||
function _msgData()
|
||||
internal
|
||||
view
|
||||
virtual
|
||||
override
|
||||
returns (bytes calldata)
|
||||
{
|
||||
if (isTrustedForwarder(msg.sender)) {
|
||||
return msg.data[:msg.data.length - 20];
|
||||
} else {
|
||||
return super._msgData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
pragma solidity 0.8.9;
|
||||
|
||||
import { ERC20 } from "../tokens/ERC20.sol";
|
||||
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
// 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`.
|
||||
///
|
||||
/// This function does NOT accept EIP-2098 short form signatures.
|
||||
/// Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098
|
||||
/// short form signatures instead.
|
||||
function recoverCalldata(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
) 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)
|
||||
// Directly copy `r` and `s` from the calldata.
|
||||
calldatacopy(0x40, signature.offset, 0x40)
|
||||
// Store the `hash` in the scratch space.
|
||||
mstore(0x00, hash)
|
||||
// Compute `v` and store it in the scratch space.
|
||||
mstore(
|
||||
0x20,
|
||||
byte(
|
||||
0,
|
||||
calldataload(add(signature.offset, 0x40))
|
||||
)
|
||||
)
|
||||
pop(
|
||||
staticcall(
|
||||
gas(), // Amount of gas left for the transaction.
|
||||
and(
|
||||
// If the signature is exactly 65 bytes in length.
|
||||
eq(signature.length, 65),
|
||||
// If `s` in lower half order, such that the signature is not malleable.
|
||||
lt(
|
||||
mload(0x60),
|
||||
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,140 +4,114 @@ 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 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)
|
||||
/// @author Solmate (https://github.com/Rari-Capital/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 {
|
||||
/// @solidity memory-safe-assembly
|
||||
bool success;
|
||||
|
||||
assembly {
|
||||
// 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)
|
||||
}
|
||||
// Transfer the ETH and store if it succeeded or not.
|
||||
success := call(gas(), to, amount, 0, 0, 0, 0)
|
||||
}
|
||||
|
||||
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 {
|
||||
/// @solidity memory-safe-assembly
|
||||
bool success;
|
||||
|
||||
assembly {
|
||||
let m := mload(0x40) // Cache the free memory pointer.
|
||||
// We'll write our calldata to this slot below, but restore it later.
|
||||
let memPointer := mload(0x40)
|
||||
|
||||
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)
|
||||
// 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.
|
||||
|
||||
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(
|
||||
eq(mload(0x00), 1),
|
||||
iszero(returndatasize())
|
||||
success := and(
|
||||
// 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)
|
||||
),
|
||||
call(
|
||||
gas(),
|
||||
token,
|
||||
0,
|
||||
0x1c,
|
||||
0x64,
|
||||
0x00,
|
||||
0x20
|
||||
)
|
||||
)
|
||||
) {
|
||||
// Store the function selector of `TransferFromFailed()`.
|
||||
mstore(0x00, 0x7939f424)
|
||||
// Revert with (offset, size).
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
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)
|
||||
)
|
||||
|
||||
mstore(0x60, 0) // Restore the zero slot to zero.
|
||||
mstore(0x40, m) // Restore the free memory pointer.
|
||||
mstore(0x40, memPointer) // Restore the memPointer.
|
||||
}
|
||||
|
||||
require(success, "TRANSFER_FROM_FAILED");
|
||||
}
|
||||
|
||||
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
|
||||
/// Reverts upon failure.
|
||||
function safeTransfer(
|
||||
ERC20 token,
|
||||
address to,
|
||||
uint256 amount
|
||||
) internal {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
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)
|
||||
bool success;
|
||||
|
||||
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(
|
||||
eq(mload(0x00), 1),
|
||||
iszero(returndatasize())
|
||||
assembly {
|
||||
// We'll write our calldata to this slot below, but restore it later.
|
||||
let memPointer := mload(0x40)
|
||||
|
||||
// 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(
|
||||
// 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)
|
||||
),
|
||||
call(
|
||||
gas(),
|
||||
token,
|
||||
0,
|
||||
0x10,
|
||||
0x44,
|
||||
0x00,
|
||||
0x20
|
||||
)
|
||||
)
|
||||
) {
|
||||
// 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)
|
||||
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)
|
||||
)
|
||||
|
||||
mstore(0x60, 0) // Restore the zero slot to zero.
|
||||
mstore(0x40, memPointer) // Restore the memPointer.
|
||||
}
|
||||
|
||||
require(success, "TRANSFER_FAILED");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.19;
|
||||
pragma solidity 0.8.9;
|
||||
|
||||
/// ______ __
|
||||
/// .-----.|__ |.-----.|__|.--.--.
|
||||
@@ -8,12 +8,19 @@ pragma solidity 0.8.19;
|
||||
/// |__| |__|
|
||||
///
|
||||
|
||||
import { OwnerSettings, ERC20, SafeTransferLib } from "contracts/core/OwnerSettings.sol";
|
||||
import { BaseUtils } from "contracts/core/BaseUtils.sol";
|
||||
import { DataTypes as DT } from "contracts/core/DataTypes.sol";
|
||||
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 BaseUtils {
|
||||
contract P2PIX is
|
||||
EventAndErrors,
|
||||
Owned(msg.sender),
|
||||
ReentrancyGuard
|
||||
{
|
||||
// solhint-disable use-forbidden-name
|
||||
// solhint-disable no-inline-assembly
|
||||
// solhint-disable no-empty-blocks
|
||||
@@ -21,51 +28,90 @@ contract P2PIX is BaseUtils {
|
||||
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,
|
||||
address _reputation,
|
||||
ERC20[] memory tokens,
|
||||
IReputation _reputation,
|
||||
address[] memory tokens,
|
||||
bool[] memory tokenStates
|
||||
)
|
||||
OwnerSettings(
|
||||
defaultBlocks,
|
||||
validSigners,
|
||||
_reputation,
|
||||
tokens,
|
||||
tokenStates
|
||||
)
|
||||
payable {/* */}
|
||||
) payable {
|
||||
setDefaultLockBlocks(defaultBlocks);
|
||||
setReputation(_reputation);
|
||||
setValidSigners(validSigners);
|
||||
tokenSettings(tokens, tokenStates);
|
||||
}
|
||||
|
||||
/// ███ Public FX ██████████████████████████████████████████████████████████
|
||||
|
||||
/// @notice Creates a deposit order based on a seller's
|
||||
/// offer of an amount of ERC20 tokens.
|
||||
/// @notice Seller needs to send his tokens to the P2PIX smart contract.
|
||||
/// @param pixTarget Pix key destination provided by the offer's seller.
|
||||
/// @dev Seller needs to send his tokens to the P2PIX smart contract.
|
||||
/// @param _pixTarget Pix key destination provided by the offer's seller.
|
||||
/// @param allowlistRoot Optional allow list merkleRoot update `bytes32` value.
|
||||
/// as the deposit identifier.
|
||||
/// @dev Function sighash: 0x5e918943
|
||||
/// @dev Function sighash: 0xbfe07da6.
|
||||
function deposit(
|
||||
string calldata pixTarget,
|
||||
bytes32 allowlistRoot,
|
||||
ERC20 token,
|
||||
uint96 amount,
|
||||
bool valid
|
||||
address _token,
|
||||
uint96 _amount,
|
||||
uint160 _pixTarget,
|
||||
bool _valid,
|
||||
bytes32 allowlistRoot
|
||||
) public {
|
||||
ERC20 t = ERC20(_token);
|
||||
uint256 k = _castAddrToKey(msg.sender);
|
||||
|
||||
if (bytes(pixTarget).length == 0) revert EmptyPixTarget();
|
||||
if (!allowedERC20s(token)) revert TokenDenied();
|
||||
uint256 _sellerBalance = __sellerBalance(msg.sender, token);
|
||||
if (_pixTarget == 0) revert EmptyPixTarget();
|
||||
if (!allowedERC20s[t]) revert TokenDenied();
|
||||
uint256 _sellerBalance = sellerBalance[k][t];
|
||||
|
||||
uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY;
|
||||
uint256 _newBal = uint256(currBal + amount);
|
||||
if (_newBal > MAXBALANCE_UPPERBOUND)
|
||||
if ((currBal + _amount) > 1e8 ether)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
setReentrancyGuard();
|
||||
@@ -74,136 +120,178 @@ contract P2PIX is BaseUtils {
|
||||
setRoot(msg.sender, allowlistRoot);
|
||||
}
|
||||
|
||||
bytes32 pixTargetCasted = getStr(pixTarget);
|
||||
uint256 validCasted = _castBool(valid);
|
||||
uint256 amountCasted;
|
||||
uint256 pixTargetCasted;
|
||||
uint256 validCasted;
|
||||
(
|
||||
amountCasted,
|
||||
pixTargetCasted,
|
||||
validCasted
|
||||
) = _castToUint(_amount, _pixTarget, _valid);
|
||||
|
||||
_setSellerBalance(
|
||||
msg.sender,
|
||||
token,
|
||||
(_newBal | (validCasted << BITPOS_VALID)),
|
||||
pixTargetCasted
|
||||
);
|
||||
sellerBalance[k][t] =
|
||||
(currBal + amountCasted) |
|
||||
(pixTargetCasted << BITPOS_PIXTARGET) |
|
||||
(validCasted << BITPOS_VALID);
|
||||
|
||||
SafeTransferLib.safeTransferFrom(
|
||||
token,
|
||||
t,
|
||||
msg.sender,
|
||||
address(this),
|
||||
amount
|
||||
_amount
|
||||
);
|
||||
|
||||
clearReentrancyGuard();
|
||||
|
||||
emit DepositAdded(msg.sender, token, amount);
|
||||
emit DepositAdded(msg.sender, _token, _amount);
|
||||
}
|
||||
|
||||
/// @notice Enables seller to invalidate future
|
||||
/// locks made to his/her token offering order.
|
||||
/// @notice This function does not affect any ongoing active locks.
|
||||
/// @dev Function sighash: 0x6d82d9e0
|
||||
/// @dev This function does not affect any ongoing active locks.
|
||||
/// @dev Function sighash: 0x72fada5c.
|
||||
function setValidState(ERC20 token, bool state) public {
|
||||
uint256 _sellerBalance = __sellerBalance(msg.sender, token);
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
uint256 _sellerBalance = sellerBalance[key][token];
|
||||
|
||||
if (_sellerBalance != 0) {
|
||||
uint256 _valid = _castBool(state);
|
||||
uint256 _valid;
|
||||
assembly {
|
||||
_valid := state
|
||||
}
|
||||
|
||||
_sellerBalance =
|
||||
(_sellerBalance & BITMASK_SB_ENTRY) |
|
||||
(_sellerBalance & BITMASK_VALID) |
|
||||
(_valid << BITPOS_VALID);
|
||||
|
||||
_setValidState(msg.sender, token, _sellerBalance);
|
||||
sellerBalance[key][token] = _sellerBalance;
|
||||
|
||||
emit ValidSet(msg.sender, token, state);
|
||||
emit ValidSet(msg.sender, address(token), state);
|
||||
} else revert NotInitialized();
|
||||
}
|
||||
|
||||
/// @notice Public method designed to lock an remaining amount of
|
||||
/// the deposit order of a seller.
|
||||
/// @notice Transaction forwarding must leave `merkleProof` empty;
|
||||
/// otherwise, the trustedForwarder must be previously added
|
||||
/// to a seller whitelist.
|
||||
/// @notice This method can be performed either by:
|
||||
/// @dev This method can be performed either by:
|
||||
/// - An user allowed via the seller's allowlist;
|
||||
/// - An user with enough userRecord to lock the wished amount;
|
||||
/// @notice There can only exist a lock per each `_amount` partitioned
|
||||
/// @dev There can only exist a lock per each `_amount` partitioned
|
||||
/// from the total `remaining` value.
|
||||
/// @notice Locks can only be performed in valid orders.
|
||||
/// @param amount The deposit's remaining amount wished to be locked.
|
||||
/// @param merkleProof Provided as a pass if the `msg.sender` is in the
|
||||
/// seller's allowlist; Left empty otherwise;
|
||||
/// @param expiredLocks An array of identifiers to be
|
||||
/// @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:
|
||||
/// - Provided as a pass if the `msg.sender` is in the seller's allowlist;
|
||||
/// - Left empty otherwise;
|
||||
/// @param expiredLocks An array of `bytes32` identifiers to be
|
||||
/// provided so to unexpire locks using this transaction gas push.
|
||||
/// @return lockID The lock identifier.
|
||||
/// @dev Function sighash: 0xdc43221c
|
||||
/// @return lockID The `bytes32` value returned as the lock identifier.
|
||||
/// @dev Function sighash: 0x03aaf306.
|
||||
function lock(
|
||||
address seller,
|
||||
ERC20 token,
|
||||
uint80 amount,
|
||||
address _seller,
|
||||
address _token,
|
||||
address _buyerAddress,
|
||||
address _relayerTarget,
|
||||
uint256 _relayerPremium,
|
||||
uint256 _amount,
|
||||
bytes32[] calldata merkleProof,
|
||||
uint256[] calldata expiredLocks
|
||||
) public nonReentrant returns (uint256 lockID) {
|
||||
) public nonReentrant returns (uint256) {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
if (!getValid(seller, token)) revert InvalidDeposit();
|
||||
ERC20 t = ERC20(_token);
|
||||
if (!getValid(_seller, t)) revert InvalidDeposit();
|
||||
|
||||
uint256 bal = getBalance(seller, token);
|
||||
if (bal < amount) revert NotEnoughTokens();
|
||||
uint256 bal = getBalance(_seller, t);
|
||||
if (bal < _amount) revert NotEnoughTokens();
|
||||
|
||||
unchecked {
|
||||
lockID = ++lockCounter;
|
||||
}
|
||||
uint256 k = _castAddrToKey(_seller);
|
||||
|
||||
uint256 cCounter = lockCounter + 1;
|
||||
|
||||
if (
|
||||
mapLocks[lockID].expirationBlock >= block.number
|
||||
mapLocks[cCounter].expirationBlock >= block.number
|
||||
) revert NotExpired();
|
||||
|
||||
bytes32 _pixTarget = getPixTarget(seller, token);
|
||||
|
||||
// transaction forwarding must leave `merkleProof` empty;
|
||||
// otherwise, the trustedForwarder must be previously added
|
||||
// to a seller whitelist.
|
||||
if (merkleProof.length != 0) {
|
||||
_merkleVerify( merkleProof, sellerAllowList(seller), _msgSender());
|
||||
|
||||
} else if ( amount > REPUTATION_LOWERBOUND && msg.sender == _msgSender() ) {
|
||||
|
||||
uint256 spendLimit; uint256 userCredit =
|
||||
userRecord[_castAddrToKey(_msgSender())];
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
if (
|
||||
amount > (spendLimit * WAD) ||
|
||||
amount > LOCKAMOUNT_UPPERBOUND
|
||||
) revert AmountNotAllowed();
|
||||
}
|
||||
|
||||
DT.Lock memory l = DT.Lock(
|
||||
lockID,
|
||||
k,
|
||||
cCounter,
|
||||
_relayerPremium,
|
||||
_amount,
|
||||
(block.number + defaultLockBlocks),
|
||||
_pixTarget,
|
||||
amount,
|
||||
token,
|
||||
_msgSender(),
|
||||
seller
|
||||
uint160(sellerBalance[k][t] >> BITPOS_PIXTARGET),
|
||||
_buyerAddress,
|
||||
_relayerTarget,
|
||||
msg.sender,
|
||||
address(t)
|
||||
);
|
||||
|
||||
_addLock(bal, l);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @notice Lock release method that liquidate lock
|
||||
/// orders and distributes relayer fees.
|
||||
/// @notice This method can be called by any public actor
|
||||
/// @dev This method can be called by any public actor
|
||||
/// as long the signature provided is valid.
|
||||
/// @notice `relayerPremium` gets splitted equaly
|
||||
/// if relayer addresses differ.
|
||||
/// @notice If the `msg.sender` of this method and `l.relayerAddress` are the same,
|
||||
/// @dev `relayerPremium` gets splitted equaly
|
||||
/// if `relayerTarget` 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;
|
||||
/// @dev Function sighash: 0x11fc7f9a
|
||||
/// @param _relayerTarget Target address entitled to the `relayerPremium`.
|
||||
/// @dev Function sighash: 0x4e1389ed.
|
||||
function release(
|
||||
uint256 lockID,
|
||||
address _relayerTarget,
|
||||
bytes32 pixTimestamp,
|
||||
bytes calldata signature
|
||||
bytes32 r,
|
||||
bytes32 s,
|
||||
uint8 v
|
||||
) public nonReentrant {
|
||||
DT.Lock storage l = mapLocks[lockID];
|
||||
|
||||
@@ -218,41 +306,81 @@ contract P2PIX is BaseUtils {
|
||||
pixTimestamp
|
||||
)
|
||||
);
|
||||
bytes32 messageDigest = keccak256(
|
||||
abi.encodePacked(
|
||||
"\x19Ethereum Signed Message:\n32",
|
||||
message
|
||||
)
|
||||
);
|
||||
|
||||
_signerCheck(message, signature);
|
||||
if (usedTransactions[message] == true)
|
||||
revert TxAlreadyUsed();
|
||||
|
||||
uint256 signer = _castAddrToKey(
|
||||
ecrecover(messageDigest, v, r, s)
|
||||
);
|
||||
|
||||
if (!validBacenSigners[signer])
|
||||
revert InvalidSigner();
|
||||
|
||||
ERC20 t = ERC20(l.token);
|
||||
|
||||
// We cache lockAmount value before zeroing it out.
|
||||
// We cache values before zeroing them out.
|
||||
uint256 lockAmount = l.amount;
|
||||
uint256 totalAmount = (lockAmount - l.relayerPremium);
|
||||
|
||||
l.amount = 0;
|
||||
l.expirationBlock = 0;
|
||||
_setUsedTransactions(message);
|
||||
|
||||
if (_msgSender() == msg.sender) {
|
||||
if (msg.sender != l.buyerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += (lockAmount >> 1);
|
||||
userRecord[_castAddrToKey(l.buyerAddress)] += (lockAmount >> 1);
|
||||
usedTransactions[message] = true;
|
||||
|
||||
if (msg.sender != l.relayerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += l
|
||||
.relayerPremium;
|
||||
userRecord[
|
||||
_castAddrToKey(l.relayerAddress)
|
||||
] += lockAmount;
|
||||
} else {
|
||||
userRecord[_castAddrToKey(msg.sender)] += lockAmount;
|
||||
}}
|
||||
userRecord[_castAddrToKey(msg.sender)] += (l
|
||||
.relayerPremium + lockAmount);
|
||||
}
|
||||
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
l.buyerAddress,
|
||||
lockAmount
|
||||
totalAmount
|
||||
);
|
||||
|
||||
// Method doesn't check for zero address.
|
||||
if (l.relayerPremium != 0) {
|
||||
if (_relayerTarget != l.relayerTarget) {
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
l.relayerTarget,
|
||||
(l.relayerPremium >> 1)
|
||||
);
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
_relayerTarget,
|
||||
(l.relayerPremium >> 1)
|
||||
);
|
||||
} else {
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
_relayerTarget,
|
||||
l.relayerPremium
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
emit LockReleased(l.buyerAddress, lockID, lockAmount);
|
||||
}
|
||||
|
||||
/// @notice Unlocks expired locks.
|
||||
/// @notice Triggered in the callgraph by both `lock` and `withdraw` functions.
|
||||
/// @notice This method can also have any public actor as its `tx.origin`.
|
||||
/// @notice For each successfull unexpired lock recovered,
|
||||
/// @dev Triggered in the callgraph by both `lock` and `withdraw` functions.
|
||||
/// @dev This method can also have any public actor as its `tx.origin`.
|
||||
/// @dev For each successfull unexpired lock recovered,
|
||||
/// `userRecord[_castAddrToKey(l.relayerAddress)]` is decreased by half of its value.
|
||||
/// @dev Function sighash: 0xb0983d39
|
||||
/// @dev Function sighash: 0x8e2749d6.
|
||||
function unlockExpired(uint256[] calldata lockIDs)
|
||||
public
|
||||
{
|
||||
@@ -264,24 +392,26 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
_notExpired(l);
|
||||
|
||||
uint256 _sellerBalance =
|
||||
__sellerBalance(l.seller, l.token) & BITMASK_SB_ENTRY;
|
||||
uint256 _sellerBalance = sellerBalance[
|
||||
l.sellerKey
|
||||
][ERC20(l.token)] & BITMASK_SB_ENTRY;
|
||||
|
||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||
if ((_sellerBalance + l.amount) > 1e8 ether)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
_addSellerBalance(l.seller, l.token, l.amount);
|
||||
sellerBalance[l.sellerKey][ERC20(l.token)] += l
|
||||
.amount;
|
||||
|
||||
l.amount = 0;
|
||||
|
||||
uint256 userKey = _castAddrToKey(
|
||||
l.buyerAddress
|
||||
l.relayerAddress
|
||||
);
|
||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||
1);
|
||||
|
||||
if (_newUserRecord <= REPUTATION_LOWERBOUND) {
|
||||
userRecord[userKey] = REPUTATION_LOWERBOUND;
|
||||
if (_newUserRecord <= 1e2 ether) {
|
||||
userRecord[userKey] = 1e2 ether;
|
||||
} else {
|
||||
userRecord[userKey] = _newUserRecord;
|
||||
}
|
||||
@@ -292,7 +422,7 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
if lt(i, locksSize) {
|
||||
// LoopOverflow()
|
||||
mstore(0x00, 0xdfb035c9)
|
||||
@@ -302,9 +432,9 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
|
||||
/// @notice Seller's expired deposit fund sweeper.
|
||||
/// @notice A seller may use this method to recover
|
||||
/// @dev A seller may use this method to recover
|
||||
/// tokens from expired deposits.
|
||||
/// @dev Function sighash: 0xfb8c5ef0
|
||||
/// @dev Function sighash: 0x36317972.
|
||||
function withdraw(
|
||||
ERC20 token,
|
||||
uint256 amount,
|
||||
@@ -312,14 +442,16 @@ contract P2PIX is BaseUtils {
|
||||
) public nonReentrant {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
if (getValid(msg.sender, token))
|
||||
if (getValid(msg.sender, token) == true) {
|
||||
setValidState(token, false);
|
||||
}
|
||||
|
||||
uint256 key = _castAddrToKey(msg.sender);
|
||||
_decBal(
|
||||
(__sellerBalance(msg.sender, token) & BITMASK_SB_ENTRY),
|
||||
(sellerBalance[key][token] & BITMASK_SB_ENTRY),
|
||||
amount,
|
||||
token,
|
||||
msg.sender
|
||||
key
|
||||
);
|
||||
|
||||
// safeTransfer tokens to seller
|
||||
@@ -331,7 +463,7 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
emit DepositWithdrawn(
|
||||
msg.sender,
|
||||
token,
|
||||
address(token),
|
||||
amount
|
||||
);
|
||||
}
|
||||
@@ -339,35 +471,114 @@ contract P2PIX is BaseUtils {
|
||||
function setRoot(address addr, bytes32 merkleroot)
|
||||
public
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
// if (addr != msg.sender)
|
||||
if iszero(eq(addr, caller())) {
|
||||
// revert OnlySeller()
|
||||
mstore(0x00, 0x85d1f726)
|
||||
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)
|
||||
revert(0x1c, 0x04)
|
||||
}
|
||||
// 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,
|
||||
_ROOT_UPDATED_EVENT_SIGNATURE,
|
||||
addr,
|
||||
merkleroot
|
||||
)
|
||||
// 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))
|
||||
log3(
|
||||
0,
|
||||
0,
|
||||
// AllowedERC20Updated(address, bool)
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a,
|
||||
mload(tLoc),
|
||||
mload(sLoc)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ███ Helper FX ██████████████████████████████████████████████████████████
|
||||
|
||||
// solhint-disable-next-line no-empty-blocks
|
||||
receive() external payable {}
|
||||
|
||||
/// @notice Private view auxiliar logic that reverts
|
||||
/// on a not expired lock passed as argument of the function.
|
||||
/// @dev Called exclusively by the `unlockExpired` method.
|
||||
/// @dev Function sighash: 0x74e2a0bb.
|
||||
function _notExpired(DT.Lock storage _l) private view {
|
||||
if (_l.expirationBlock > block.number)
|
||||
revert NotExpired();
|
||||
@@ -376,32 +587,111 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
function _addLock(
|
||||
uint256 _bal,
|
||||
DT.Lock memory _l
|
||||
uint256 _amount,
|
||||
uint256 _lockID,
|
||||
DT.Lock memory _l,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) internal {
|
||||
mapLocks[_l.counter] = _l;
|
||||
mapLocks[_lockID] = _l;
|
||||
|
||||
_decBal(_bal, _l.amount, ERC20(_l.token), _l.seller);
|
||||
_decBal(_bal, _amount, _t, _k);
|
||||
|
||||
emit LockAdded(
|
||||
_l.buyerAddress,
|
||||
_l.counter,
|
||||
_l.seller,
|
||||
_lockID,
|
||||
_l.sellerKey,
|
||||
_l.amount
|
||||
);
|
||||
}
|
||||
|
||||
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,
|
||||
ERC20 _t,
|
||||
address _k
|
||||
uint256 _k
|
||||
) private {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
if iszero(
|
||||
iszero(
|
||||
or(
|
||||
iszero(_bal),
|
||||
gt(sub(_bal, _amount), _bal)
|
||||
lt(sub(_bal, _amount), 0x0)
|
||||
)
|
||||
)
|
||||
) {
|
||||
@@ -412,7 +702,7 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
|
||||
// we can directly dec from packed uint entry value
|
||||
_decSellerBalance(_k,_t, _amount);
|
||||
sellerBalance[_k][_t] -= _amount;
|
||||
}
|
||||
|
||||
function getBalance(address seller, ERC20 token)
|
||||
@@ -420,18 +710,23 @@ contract P2PIX is BaseUtils {
|
||||
view
|
||||
returns (uint256 bal)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
// bal =
|
||||
// sellerBalance[_castAddrToKey(seller)][token] &
|
||||
// BITMASK_SB_ENTRY;
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
} iszero(0x0) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
mstore(0x00, shl(0xC, seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
bal := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
sload(add(keccak256(0x0c, 0x34), 0x01))
|
||||
sload(keccak256(0x00, 0x40))
|
||||
)
|
||||
break
|
||||
}
|
||||
@@ -443,20 +738,26 @@ contract P2PIX is BaseUtils {
|
||||
view
|
||||
returns (bool valid)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
// uint256 b = sellerBalance[
|
||||
// _castAddrToKey(seller)
|
||||
// ][token];
|
||||
// ] >> BITPOS_VALID) & BITMASK_SB_ENTRY;
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
} iszero(0x0) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
mstore(0x00, shl(0xC, seller))
|
||||
mstore(0x20, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0x00, 0x40)
|
||||
mstore(0x00, token)
|
||||
mstore(0x20, sbkslot)
|
||||
valid := and(
|
||||
BITMASK_SB_ENTRY,
|
||||
shr(
|
||||
BITPOS_VALID,
|
||||
sload(add(keccak256(0x0c, 0x34), 0x01))
|
||||
sload(keccak256(0x00, 0x40))
|
||||
)
|
||||
)
|
||||
break
|
||||
@@ -467,28 +768,32 @@ contract P2PIX is BaseUtils {
|
||||
function getPixTarget(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (bytes32 pixTarget)
|
||||
returns (uint160 pixTarget)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
// pixTarget = uint160(
|
||||
// sellerBalance[_castAddrToKey(seller)][token] >>
|
||||
// BITPOS_PIXTARGET
|
||||
// );
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
} iszero(0) {
|
||||
/* */
|
||||
} {
|
||||
mstore(0x20, token)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, seller)
|
||||
pixTarget := sload(keccak256(0x0c, 0x34))
|
||||
mstore(0, shl(12, seller))
|
||||
mstore(32, sellerBalance.slot)
|
||||
let sbkslot := keccak256(0, 64)
|
||||
mstore(0, token)
|
||||
mstore(32, sbkslot)
|
||||
pixTarget := shr(
|
||||
BITPOS_PIXTARGET,
|
||||
sload(keccak256(0, 64))
|
||||
)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getPixTargetString(address seller, ERC20 token) public view returns (string memory pixTarget) {
|
||||
bytes32 _pixEnc = getPixTarget(seller, token);
|
||||
pixTarget = string(abi.encodePacked(_pixEnc));
|
||||
}
|
||||
|
||||
function getBalances(
|
||||
address[] memory sellers,
|
||||
ERC20 token
|
||||
@@ -508,7 +813,7 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
|
||||
/// @notice External getter that returns the status of a lockIDs array.
|
||||
/// @notice Call will not revert if provided with an empty array as parameter.
|
||||
/// @dev Call will not revert if provided with an empty array as parameter.
|
||||
/// @dev Function sighash: 0x49ef8448
|
||||
function getLocksStatus(uint256[] memory ids)
|
||||
external
|
||||
@@ -531,7 +836,7 @@ contract P2PIX is BaseUtils {
|
||||
);
|
||||
unchecked {
|
||||
for (c; c < len; ) {
|
||||
if (mapLocks[ids[c]].seller == address(0)) {
|
||||
if (mapLocks[ids[c]].sellerKey == 0x0) {
|
||||
sortedIDs[c] = ids[c];
|
||||
status[c] = type(DT.LockStatus).min;
|
||||
++c;
|
||||
@@ -555,4 +860,29 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
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;
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"signers": [
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
||||
],
|
||||
"token": "0xfE841c74250e57640390f46d914C88d22C51e82e",
|
||||
"p2pix": "0x98ba35eb14b38D6Aa709338283af3e922476dE34"
|
||||
}
|
||||
@@ -1,28 +1,6 @@
|
||||
# Solidity API
|
||||
# Reputation
|
||||
|
||||
## Reputation
|
||||
|
||||
### maxLimit
|
||||
|
||||
```solidity
|
||||
uint256 maxLimit
|
||||
```
|
||||
|
||||
_Asymptote numerator constant value for the `limiter` fx._
|
||||
|
||||
### magicValue
|
||||
|
||||
```solidity
|
||||
uint256 magicValue
|
||||
```
|
||||
|
||||
_Denominator's constant operand for the `limiter` fx._
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor() public payable
|
||||
```
|
||||
## Methods
|
||||
|
||||
### limiter
|
||||
|
||||
@@ -30,12 +8,81 @@ constructor() public payable
|
||||
function limiter(uint256 _userCredit) external pure returns (uint256 _spendLimit)
|
||||
```
|
||||
|
||||
### sqrt
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | ----------- |
|
||||
| \_userCredit | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | ----------- |
|
||||
| \_spendLimit | uint256 | undefined |
|
||||
|
||||
### magicValue
|
||||
|
||||
```solidity
|
||||
function sqrt(uint256 x) internal pure returns (uint256 z)
|
||||
function magicValue() external view returns (uint256)
|
||||
```
|
||||
|
||||
Taken from Solmate's FixedPointMathLib.
|
||||
(https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
|
||||
_Denominator's constant operand for the `limiter` fx. _
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### maxLimit
|
||||
|
||||
```solidity
|
||||
function maxLimit() external view returns (uint256)
|
||||
```
|
||||
|
||||
_Asymptote numerator constant value for the `limiter` fx._
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### owner
|
||||
|
||||
```solidity
|
||||
function owner() external view returns (address)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
|
||||
### setOwner
|
||||
|
||||
```solidity
|
||||
function setOwner(address newOwner) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| newOwner | address | undefined |
|
||||
|
||||
## Events
|
||||
|
||||
### OwnerUpdated
|
||||
|
||||
```solidity
|
||||
event OwnerUpdated(address indexed user, address indexed newOwner)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------ | ------- | ----------- |
|
||||
| user `indexed` | address | undefined |
|
||||
| newOwner `indexed` | address | undefined |
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## BaseUtils
|
||||
|
||||
### _setUsedTransactions
|
||||
|
||||
```solidity
|
||||
function _setUsedTransactions(bytes32 message) internal
|
||||
```
|
||||
|
||||
███ Helper FX ██████████████████████████████████████████████████████████
|
||||
|
||||
### usedTransactions
|
||||
|
||||
```solidity
|
||||
function usedTransactions(bytes32 message) public view returns (bool used)
|
||||
```
|
||||
|
||||
### _signerCheck
|
||||
|
||||
```solidity
|
||||
function _signerCheck(bytes32 _message, bytes _signature) internal view
|
||||
```
|
||||
|
||||
### _merkleVerify
|
||||
|
||||
```solidity
|
||||
function _merkleVerify(bytes32[] _merkleProof, bytes32 _root, address _addr) internal pure
|
||||
```
|
||||
|
||||
### _castBool
|
||||
|
||||
```solidity
|
||||
function _castBool(bool _valid) internal pure returns (uint256 _validCasted)
|
||||
```
|
||||
|
||||
### getStr
|
||||
|
||||
```solidity
|
||||
function getStr(string str) public pure returns (bytes32 strEnc)
|
||||
```
|
||||
|
||||
### _setSellerBalance
|
||||
|
||||
```solidity
|
||||
function _setSellerBalance(address _sellerKey, contract ERC20 _erc20, uint256 _packed, bytes32 _pixTarget) internal
|
||||
```
|
||||
|
||||
### _setValidState
|
||||
|
||||
```solidity
|
||||
function _setValidState(address _sellerKey, contract ERC20 _erc20, uint256 _packed) internal
|
||||
```
|
||||
|
||||
### _addSellerBalance
|
||||
|
||||
```solidity
|
||||
function _addSellerBalance(address _sellerKey, contract ERC20 _erc20, uint256 _amount) internal
|
||||
```
|
||||
|
||||
### _decSellerBalance
|
||||
|
||||
```solidity
|
||||
function _decSellerBalance(address _sellerKey, contract ERC20 _erc20, uint256 _amount) internal
|
||||
```
|
||||
|
||||
### __sellerBalance
|
||||
|
||||
```solidity
|
||||
function __sellerBalance(address _sellerKey, contract ERC20 _erc20) internal view returns (uint256 _packed)
|
||||
```
|
||||
|
||||
### _castAddrToKey
|
||||
|
||||
```solidity
|
||||
function _castAddrToKey(address _addr) public pure returns (uint256 _key)
|
||||
```
|
||||
|
||||
Public method that handles `address`
|
||||
to `uint256` safe type casting.
|
||||
|
||||
_Function sighash: 0x4b2ae980._
|
||||
|
||||
### _castKeyToAddr
|
||||
|
||||
```solidity
|
||||
function _castKeyToAddr(uint256 _key) public pure returns (address _addr)
|
||||
```
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## Constants
|
||||
|
||||
### _ROOT_UPDATED_EVENT_SIGNATURE
|
||||
|
||||
```solidity
|
||||
uint256 _ROOT_UPDATED_EVENT_SIGNATURE
|
||||
```
|
||||
|
||||
███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
### _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE
|
||||
|
||||
```solidity
|
||||
uint256 _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE
|
||||
```
|
||||
|
||||
### _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE
|
||||
|
||||
```solidity
|
||||
uint256 _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE
|
||||
```
|
||||
|
||||
### _SELLER_ALLOWLIST_SLOT_SEED
|
||||
|
||||
```solidity
|
||||
uint256 _SELLER_ALLOWLIST_SLOT_SEED
|
||||
```
|
||||
|
||||
_Seller casted to key => Seller's allowlist merkleroot.
|
||||
mapping(uint256 => bytes32) public sellerAllowList;_
|
||||
|
||||
### _ALLOWED_ERC20_SLOT_SEED
|
||||
|
||||
```solidity
|
||||
uint256 _ALLOWED_ERC20_SLOT_SEED
|
||||
```
|
||||
|
||||
_Tokens allowed to serve as the underlying amount of a deposit.
|
||||
mapping(ERC20 => bool) public allowedERC20s;_
|
||||
|
||||
### _SELLER_BALANCE_SLOT_SEED
|
||||
|
||||
```solidity
|
||||
uint256 _SELLER_BALANCE_SLOT_SEED
|
||||
```
|
||||
|
||||
_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))._
|
||||
|
||||
### BITMASK_SB_ENTRY
|
||||
|
||||
```solidity
|
||||
uint256 BITMASK_SB_ENTRY
|
||||
```
|
||||
|
||||
_The bitmask of `sellerBalance` entry._
|
||||
|
||||
### BITPOS_VALID
|
||||
|
||||
```solidity
|
||||
uint256 BITPOS_VALID
|
||||
```
|
||||
|
||||
_The bit position of `valid` in `sellerBalance`._
|
||||
|
||||
### WAD
|
||||
|
||||
```solidity
|
||||
uint256 WAD
|
||||
```
|
||||
|
||||
_The scalar of BRZ token._
|
||||
|
||||
### MAXBALANCE_UPPERBOUND
|
||||
|
||||
```solidity
|
||||
uint256 MAXBALANCE_UPPERBOUND
|
||||
```
|
||||
|
||||
### REPUTATION_LOWERBOUND
|
||||
|
||||
```solidity
|
||||
uint256 REPUTATION_LOWERBOUND
|
||||
```
|
||||
|
||||
### LOCKAMOUNT_UPPERBOUND
|
||||
|
||||
```solidity
|
||||
uint256 LOCKAMOUNT_UPPERBOUND
|
||||
```
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## OwnerSettings
|
||||
|
||||
### reputation
|
||||
|
||||
```solidity
|
||||
contract IReputation reputation
|
||||
```
|
||||
|
||||
_List of valid Bacen signature addresses
|
||||
mapping(uint256 => bool) public validBacenSigners;
|
||||
Value in custom storage slot given by:
|
||||
let value := sload(shl(12, address))._
|
||||
|
||||
### defaultLockBlocks
|
||||
|
||||
```solidity
|
||||
uint256 defaultLockBlocks
|
||||
```
|
||||
|
||||
_Default blocks that lock will hold tokens._
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor(uint256 defaultBlocks, address[] validSigners, address _reputation, contract ERC20[] tokens, bool[] tokenStates) internal
|
||||
```
|
||||
|
||||
███ Constructor ████████████████████████████████████████████████████████
|
||||
|
||||
### setTrustedFowarders
|
||||
|
||||
```solidity
|
||||
function setTrustedFowarders(address[] forwarders, bool[] states) external
|
||||
```
|
||||
|
||||
███ Owner Only █████████████████████████████████████████████████████████
|
||||
|
||||
### withdrawBalance
|
||||
|
||||
```solidity
|
||||
function withdrawBalance() external
|
||||
```
|
||||
|
||||
_Contract's underlying balance withdraw method.
|
||||
Function sighash: 0x5fd8c710._
|
||||
|
||||
### setReputation
|
||||
|
||||
```solidity
|
||||
function setReputation(contract IReputation _reputation) public
|
||||
```
|
||||
|
||||
### setDefaultLockBlocks
|
||||
|
||||
```solidity
|
||||
function setDefaultLockBlocks(uint256 _blocks) public
|
||||
```
|
||||
|
||||
### setValidSigners
|
||||
|
||||
```solidity
|
||||
function setValidSigners(address[] _validSigners) public
|
||||
```
|
||||
|
||||
### tokenSettings
|
||||
|
||||
```solidity
|
||||
function tokenSettings(contract ERC20[] _tokens, bool[] _states) public
|
||||
```
|
||||
|
||||
### validBacenSigners
|
||||
|
||||
```solidity
|
||||
function validBacenSigners(uint256 signer) public view returns (bool valid)
|
||||
```
|
||||
|
||||
███ View FX ████████████████████████████████████████████████████████████
|
||||
|
||||
### sellerAllowList
|
||||
|
||||
```solidity
|
||||
function sellerAllowList(address sellerKey) public view returns (bytes32 root)
|
||||
```
|
||||
|
||||
### allowedERC20s
|
||||
|
||||
```solidity
|
||||
function allowedERC20s(contract ERC20 erc20) public view returns (bool state)
|
||||
```
|
||||
|
||||
### _limiter
|
||||
|
||||
```solidity
|
||||
function _limiter(uint256 _userCredit) internal view returns (uint256 _spendLimit)
|
||||
```
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
# Solidity API
|
||||
# Owned
|
||||
|
||||
## Owned
|
||||
_Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Owned.sol)_
|
||||
|
||||
Simple single owner authorization mixin.
|
||||
|
||||
### Unauthorized
|
||||
|
||||
```solidity
|
||||
error Unauthorized()
|
||||
```
|
||||
|
||||
### OwnerUpdated
|
||||
|
||||
```solidity
|
||||
event OwnerUpdated(address user, address newOwner)
|
||||
```
|
||||
## Methods
|
||||
|
||||
### owner
|
||||
|
||||
```solidity
|
||||
address owner
|
||||
function owner() external view returns (address)
|
||||
```
|
||||
|
||||
### onlyOwner
|
||||
#### Returns
|
||||
|
||||
```solidity
|
||||
modifier onlyOwner()
|
||||
```
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor(address _owner) internal
|
||||
```
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
|
||||
### setOwner
|
||||
|
||||
```solidity
|
||||
function setOwner(address newOwner) public virtual
|
||||
function setOwner(address newOwner) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| newOwner | address | undefined |
|
||||
|
||||
## Events
|
||||
|
||||
### OwnerUpdated
|
||||
|
||||
```solidity
|
||||
event OwnerUpdated(address indexed user, address indexed newOwner)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------ | ------- | ----------- |
|
||||
| user `indexed` | address | undefined |
|
||||
| newOwner `indexed` | address | undefined |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Solidity API
|
||||
# IReputation
|
||||
|
||||
## IReputation
|
||||
## Methods
|
||||
|
||||
### limiter
|
||||
|
||||
@@ -8,3 +8,14 @@
|
||||
function limiter(uint256 _userCredit) external pure returns (uint256 _spendLimit)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | ----------- |
|
||||
| \_userCredit | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | ----------- |
|
||||
| \_spendLimit | uint256 | undefined |
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## Context
|
||||
|
||||
_Provides information about the current execution context, including the
|
||||
sender of the transaction and its data. While these are generally available
|
||||
via msg.sender and msg.data, they should not be accessed in such a direct
|
||||
manner, since when dealing with meta-transactions the account sending and
|
||||
paying for execution may not be the actual sender (as far as an application
|
||||
is concerned).
|
||||
|
||||
This contract is only required for intermediate, library-like contracts._
|
||||
|
||||
### _msgSender
|
||||
|
||||
```solidity
|
||||
function _msgSender() internal view virtual returns (address)
|
||||
```
|
||||
|
||||
### _msgData
|
||||
|
||||
```solidity
|
||||
function _msgData() internal view virtual returns (bytes)
|
||||
```
|
||||
|
||||
## ERC2771Context
|
||||
|
||||
_Context variant with ERC2771 support._
|
||||
|
||||
### trustedForwarders
|
||||
|
||||
```solidity
|
||||
mapping(address => bool) trustedForwarders
|
||||
```
|
||||
|
||||
### _msgSender
|
||||
|
||||
```solidity
|
||||
function _msgSender() internal view virtual returns (address sender)
|
||||
```
|
||||
|
||||
### isTrustedForwarder
|
||||
|
||||
```solidity
|
||||
function isTrustedForwarder(address forwarder) public view virtual returns (bool)
|
||||
```
|
||||
|
||||
### _msgData
|
||||
|
||||
```solidity
|
||||
function _msgData() internal view virtual returns (bytes)
|
||||
```
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## MockToken
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor(uint256 supply) public
|
||||
```
|
||||
|
||||
### mint
|
||||
|
||||
```solidity
|
||||
function mint(address[] to, uint256 value) public virtual
|
||||
```
|
||||
|
||||
@@ -1,128 +1,230 @@
|
||||
# Solidity API
|
||||
# ERC20
|
||||
|
||||
## ERC20
|
||||
_Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)_
|
||||
|
||||
Modern and gas efficient ERC20 + EIP-2612 implementation.
|
||||
|
||||
_Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it._
|
||||
|
||||
### Transfer
|
||||
|
||||
```solidity
|
||||
event Transfer(address from, address to, uint256 amount)
|
||||
```
|
||||
|
||||
### Approval
|
||||
|
||||
```solidity
|
||||
event Approval(address owner, address spender, uint256 amount)
|
||||
```
|
||||
|
||||
### name
|
||||
|
||||
```solidity
|
||||
string name
|
||||
```
|
||||
|
||||
### symbol
|
||||
|
||||
```solidity
|
||||
string symbol
|
||||
```
|
||||
|
||||
### decimals
|
||||
|
||||
```solidity
|
||||
uint8 decimals
|
||||
```
|
||||
|
||||
### totalSupply
|
||||
|
||||
```solidity
|
||||
uint256 totalSupply
|
||||
```
|
||||
|
||||
### balanceOf
|
||||
|
||||
```solidity
|
||||
mapping(address => uint256) balanceOf
|
||||
```
|
||||
|
||||
### allowance
|
||||
|
||||
```solidity
|
||||
mapping(address => mapping(address => uint256)) allowance
|
||||
```
|
||||
|
||||
### INITIAL_CHAIN_ID
|
||||
|
||||
```solidity
|
||||
uint256 INITIAL_CHAIN_ID
|
||||
```
|
||||
|
||||
### INITIAL_DOMAIN_SEPARATOR
|
||||
|
||||
```solidity
|
||||
bytes32 INITIAL_DOMAIN_SEPARATOR
|
||||
```
|
||||
|
||||
### nonces
|
||||
|
||||
```solidity
|
||||
mapping(address => uint256) nonces
|
||||
```
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor(string _name, string _symbol, uint8 _decimals) internal
|
||||
```
|
||||
|
||||
### approve
|
||||
|
||||
```solidity
|
||||
function approve(address spender, uint256 amount) public virtual returns (bool)
|
||||
```
|
||||
|
||||
### transfer
|
||||
|
||||
```solidity
|
||||
function transfer(address to, uint256 amount) public virtual returns (bool)
|
||||
```
|
||||
|
||||
### transferFrom
|
||||
|
||||
```solidity
|
||||
function transferFrom(address from, address to, uint256 amount) public virtual returns (bool)
|
||||
```
|
||||
|
||||
### permit
|
||||
|
||||
```solidity
|
||||
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual
|
||||
```
|
||||
## Methods
|
||||
|
||||
### DOMAIN_SEPARATOR
|
||||
|
||||
```solidity
|
||||
function DOMAIN_SEPARATOR() public view virtual returns (bytes32)
|
||||
function DOMAIN_SEPARATOR() external view returns (bytes32)
|
||||
```
|
||||
|
||||
### computeDomainSeparator
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | bytes32 | undefined |
|
||||
|
||||
### allowance
|
||||
|
||||
```solidity
|
||||
function computeDomainSeparator() internal view virtual returns (bytes32)
|
||||
function allowance(address, address) external view returns (uint256)
|
||||
```
|
||||
|
||||
### _mint
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
| \_1 | address | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### approve
|
||||
|
||||
```solidity
|
||||
function _mint(address to, uint256 amount) internal virtual
|
||||
function approve(address spender, uint256 amount) external nonpayable returns (bool)
|
||||
```
|
||||
|
||||
### _burn
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | ------- | ----------- |
|
||||
| spender | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| \_0 | bool | undefined |
|
||||
|
||||
### balanceOf
|
||||
|
||||
```solidity
|
||||
function _burn(address from, uint256 amount) internal virtual
|
||||
function balanceOf(address) external view returns (uint256)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### decimals
|
||||
|
||||
```solidity
|
||||
function decimals() external view returns (uint8)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ----- | ----------- |
|
||||
| \_0 | uint8 | undefined |
|
||||
|
||||
### name
|
||||
|
||||
```solidity
|
||||
function name() external view returns (string)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------ | ----------- |
|
||||
| \_0 | string | undefined |
|
||||
|
||||
### nonces
|
||||
|
||||
```solidity
|
||||
function nonces(address) external view returns (uint256)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### permit
|
||||
|
||||
```solidity
|
||||
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| owner | address | undefined |
|
||||
| spender | address | undefined |
|
||||
| value | uint256 | undefined |
|
||||
| deadline | uint256 | undefined |
|
||||
| v | uint8 | undefined |
|
||||
| r | bytes32 | undefined |
|
||||
| s | bytes32 | undefined |
|
||||
|
||||
### symbol
|
||||
|
||||
```solidity
|
||||
function symbol() external view returns (string)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------ | ----------- |
|
||||
| \_0 | string | undefined |
|
||||
|
||||
### totalSupply
|
||||
|
||||
```solidity
|
||||
function totalSupply() external view returns (uint256)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### transfer
|
||||
|
||||
```solidity
|
||||
function transfer(address to, uint256 amount) external nonpayable returns (bool)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| to | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| \_0 | bool | undefined |
|
||||
|
||||
### transferFrom
|
||||
|
||||
```solidity
|
||||
function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| from | address | undefined |
|
||||
| to | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| \_0 | bool | undefined |
|
||||
|
||||
## Events
|
||||
|
||||
### Approval
|
||||
|
||||
```solidity
|
||||
event Approval(address indexed owner, address indexed spender, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------------- | ------- | ----------- |
|
||||
| owner `indexed` | address | undefined |
|
||||
| spender `indexed` | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### Transfer
|
||||
|
||||
```solidity
|
||||
event Transfer(address indexed from, address indexed to, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | ------- | ----------- |
|
||||
| from `indexed` | address | undefined |
|
||||
| to `indexed` | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## ECDSA
|
||||
|
||||
Gas optimized ECDSA wrapper.
|
||||
|
||||
### InvalidSignature
|
||||
|
||||
```solidity
|
||||
error InvalidSignature()
|
||||
```
|
||||
|
||||
_The signature is invalid._
|
||||
|
||||
### recoverCalldata
|
||||
|
||||
```solidity
|
||||
function recoverCalldata(bytes32 hash, bytes signature) internal view returns (address result)
|
||||
```
|
||||
|
||||
_Recovers the signer's address from a message digest `hash`,
|
||||
and the `signature`.
|
||||
|
||||
This function does NOT accept EIP-2098 short form signatures.
|
||||
Use `recover(bytes32 hash, bytes32 r, bytes32 vs)` for EIP-2098
|
||||
short form signatures instead._
|
||||
|
||||
### toEthSignedMessageHash
|
||||
|
||||
```solidity
|
||||
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result)
|
||||
```
|
||||
|
||||
_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._
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
# Solidity API
|
||||
# MerkleProofLib
|
||||
|
||||
## MerkleProofLib
|
||||
_Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol)_
|
||||
|
||||
Gas optimized verification of proof of inclusion for a leaf in a Merkle tree.
|
||||
|
||||
### verify
|
||||
|
||||
```solidity
|
||||
function verify(bytes32[] proof, bytes32 root, bytes32 leaf) internal pure returns (bool isValid)
|
||||
```
|
||||
|
||||
_Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`._
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## Multicall
|
||||
|
||||
Contract that batches view function calls and aggregates their results.
|
||||
|
||||
### CallFailed
|
||||
|
||||
```solidity
|
||||
error CallFailed(string reason)
|
||||
```
|
||||
|
||||
_0x_
|
||||
|
||||
### Call
|
||||
|
||||
```solidity
|
||||
struct Call {
|
||||
address target;
|
||||
bytes callData;
|
||||
}
|
||||
```
|
||||
|
||||
### Result
|
||||
|
||||
```solidity
|
||||
struct Result {
|
||||
bool success;
|
||||
bytes returnData;
|
||||
}
|
||||
```
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor() public payable
|
||||
```
|
||||
|
||||
### mtc1
|
||||
|
||||
```solidity
|
||||
function mtc1(struct Multicall.Call[] calls) external returns (uint256, bytes[])
|
||||
```
|
||||
|
||||
### mtc2
|
||||
|
||||
```solidity
|
||||
function mtc2(struct Multicall.Call[] calls) external returns (uint256, bytes32, struct Multicall.Result[])
|
||||
```
|
||||
|
||||
@@ -1,34 +1,13 @@
|
||||
# Solidity API
|
||||
# ReentrancyGuard
|
||||
|
||||
## ReentrancyGuard
|
||||
_z0r0z.ethModified from Seaport (https://github.com/ProjectOpenSea/seaport/blob/main/contracts/lib/ReentrancyGuard.sol)Modified from Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)_
|
||||
|
||||
Reentrancy protection for smart contracts.
|
||||
|
||||
## Errors
|
||||
|
||||
### Reentrancy
|
||||
|
||||
```solidity
|
||||
error Reentrancy()
|
||||
```
|
||||
|
||||
### nonReentrant
|
||||
|
||||
```solidity
|
||||
modifier nonReentrant()
|
||||
```
|
||||
|
||||
### setReentrancyGuard
|
||||
|
||||
```solidity
|
||||
function setReentrancyGuard() internal virtual
|
||||
```
|
||||
|
||||
_Check guard sentinel value and set it._
|
||||
|
||||
### clearReentrancyGuard
|
||||
|
||||
```solidity
|
||||
function clearReentrancyGuard() internal virtual
|
||||
```
|
||||
|
||||
_Unset sentinel value._
|
||||
|
||||
|
||||
@@ -1,62 +1,7 @@
|
||||
# Solidity API
|
||||
# SafeTransferLib
|
||||
|
||||
## SafeTransferLib
|
||||
_Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)_
|
||||
|
||||
Safe ETH and ERC20 transfer library that gracefully handles missing return values.
|
||||
|
||||
_Caution! This library won't check that a token has code, responsibility is delegated to the caller._
|
||||
|
||||
### ETHTransferFailed
|
||||
|
||||
```solidity
|
||||
error ETHTransferFailed()
|
||||
```
|
||||
|
||||
_The ETH transfer has failed._
|
||||
|
||||
### TransferFromFailed
|
||||
|
||||
```solidity
|
||||
error TransferFromFailed()
|
||||
```
|
||||
|
||||
_The ERC20 `transferFrom` has failed._
|
||||
|
||||
### TransferFailed
|
||||
|
||||
```solidity
|
||||
error TransferFailed()
|
||||
```
|
||||
|
||||
_The ERC20 `transfer` has failed._
|
||||
|
||||
### safeTransferETH
|
||||
|
||||
```solidity
|
||||
function safeTransferETH(address to, uint256 amount) internal
|
||||
```
|
||||
|
||||
_Sends `amount` (in wei) ETH to `to`.
|
||||
Reverts upon failure._
|
||||
|
||||
### safeTransferFrom
|
||||
|
||||
```solidity
|
||||
function safeTransferFrom(contract ERC20 token, address from, address to, uint256 amount) internal
|
||||
```
|
||||
|
||||
_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._
|
||||
|
||||
### safeTransfer
|
||||
|
||||
```solidity
|
||||
function safeTransfer(contract ERC20 token, address to, uint256 amount) internal
|
||||
```
|
||||
|
||||
_Sends `amount` of ERC20 `token` from the current contract to `to`.
|
||||
Reverts upon failure._
|
||||
|
||||
_Caution! This library won't check that a token has code, responsibility is delegated to the caller._
|
||||
|
||||
@@ -4,9 +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";
|
||||
import "solidity-docgen";
|
||||
|
||||
dotenvConfig({ path: resolve(__dirname, "./.env") });
|
||||
|
||||
@@ -38,8 +36,6 @@ const chainIds = {
|
||||
sepolia: 11155111,
|
||||
goerli: 5,
|
||||
"polygon-mumbai": 80001,
|
||||
rootstock:30,
|
||||
rsktestnet:31,
|
||||
};
|
||||
|
||||
function getChainConfig(
|
||||
@@ -52,12 +48,6 @@ function getChainConfig(
|
||||
"https://polygon-mumbai.g.alchemy.com/v2/" +
|
||||
alchemyApiKey;
|
||||
break;
|
||||
case "rsktestnet":
|
||||
jsonRpcUrl = "https://public-node.testnet.rsk.co/";
|
||||
break;
|
||||
case "rootstock":
|
||||
jsonRpcUrl = "https://public-node.rsk.co/"
|
||||
break;
|
||||
default:
|
||||
jsonRpcUrl =
|
||||
"https://" + chain + ".infura.io/v3/" + infuraApiKey;
|
||||
@@ -84,6 +74,17 @@ 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: !!(
|
||||
@@ -112,8 +113,6 @@ const config: HardhatUserConfig = {
|
||||
goerli: getChainConfig("goerli"),
|
||||
sepolia: getChainConfig("sepolia"),
|
||||
"polygon-mumbai": getChainConfig("polygon-mumbai"),
|
||||
rootstock: getChainConfig("rootstock"),
|
||||
rsktestnet: getChainConfig("rsktestnet"),
|
||||
},
|
||||
paths: {
|
||||
artifacts: "./artifacts",
|
||||
@@ -122,24 +121,16 @@ const config: HardhatUserConfig = {
|
||||
tests: "./test",
|
||||
},
|
||||
solidity: {
|
||||
version: "0.8.19",
|
||||
version: "0.8.9",
|
||||
settings: {
|
||||
viaIR: true,
|
||||
evmVersion: "paris",
|
||||
// viaIR: true,
|
||||
metadata: {
|
||||
bytecodeHash: "none",
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -147,9 +138,6 @@ const config: HardhatUserConfig = {
|
||||
outDir: "src/types",
|
||||
target: "ethers-v5",
|
||||
},
|
||||
docgen: {
|
||||
pages: "files",
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
"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",
|
||||
@@ -79,7 +78,6 @@
|
||||
"solhint": "^3.3.7",
|
||||
"solhint-plugin-prettier": "^0.0.5",
|
||||
"solidity-coverage": "^0.8.2",
|
||||
"solidity-docgen": "^0.6.0-beta.36",
|
||||
"ts-generator": "^0.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typechain": "^8.1.1",
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as fs from "fs";
|
||||
import { ethers, network } from "hardhat";
|
||||
import hre from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/interfaces";
|
||||
import { Deploys } from "../test/utils/fixtures";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
const supply: BigNumber = ethers.utils.parseEther("20000000");
|
||||
@@ -42,10 +42,10 @@ const main = async () => {
|
||||
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET/PUBLIC TESTNETS */
|
||||
// verify
|
||||
// await hre.run("verify:verify", {
|
||||
// address: erc20.address,
|
||||
// constructorArguments: [supply],
|
||||
// });
|
||||
await hre.run("verify:verify", {
|
||||
address: erc20.address,
|
||||
constructorArguments: [supply],
|
||||
});
|
||||
};
|
||||
|
||||
main()
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as fs from "fs";
|
||||
import { ethers, network } from "hardhat";
|
||||
import hre from "hardhat";
|
||||
|
||||
import { Deploys } from "../test/utils/interfaces";
|
||||
import { Deploys } from "../test/utils/fixtures";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
|
||||
@@ -57,24 +57,24 @@ const main = async () => {
|
||||
|
||||
/* UNCOMMENT WHEN DEPLOYING TO MAINNET/PUBLIC TESTNETS */
|
||||
//verify
|
||||
// await hre.run("verify:verify", {
|
||||
// address: p2pix.address,
|
||||
// constructorArguments: [
|
||||
// 10,
|
||||
// deploysJson.signers,
|
||||
// reputation.address,
|
||||
// [deploysJson.token],
|
||||
// [true],
|
||||
// ],
|
||||
// });
|
||||
// await hre.run("verify:verify", {
|
||||
// address: reputation.address,
|
||||
// constructorArguments: [],
|
||||
// });
|
||||
// await hre.run("verify:verify", {
|
||||
// address: mutlicall.address,
|
||||
// constructorArguments: [],
|
||||
// });
|
||||
await hre.run("verify:verify", {
|
||||
address: p2pix.address,
|
||||
constructorArguments: [
|
||||
10,
|
||||
deploysJson.signers,
|
||||
reputation.address,
|
||||
[deploysJson.token],
|
||||
[true],
|
||||
],
|
||||
});
|
||||
await hre.run("verify:verify", {
|
||||
address: reputation.address,
|
||||
constructorArguments: [],
|
||||
});
|
||||
await hre.run("verify:verify", {
|
||||
address: mutlicall.address,
|
||||
constructorArguments: [],
|
||||
});
|
||||
};
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import "@nomiclabs/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-etherscan";
|
||||
import * as fs from "fs";
|
||||
import { ethers, network } from "hardhat";
|
||||
import { Deploys } from "../test/utils/interfaces";
|
||||
import { P2PIX__factory } from "../src/types";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
const data = fs.readFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
{ encoding: "utf-8" },
|
||||
);
|
||||
deploysJson = JSON.parse(data);
|
||||
} catch (err) {
|
||||
console.log("Error loading Master address: ", err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Signing transactions with ${deployer.address}`);
|
||||
|
||||
const iface = new ethers.utils.Interface(P2PIX__factory.abi);
|
||||
const calldata = iface.encodeFunctionData("setDefaultLockBlocks", ["10000"]);
|
||||
|
||||
const tx = await deployer.sendTransaction({to:deploysJson.p2pix, data: calldata});
|
||||
const done = await tx.wait();
|
||||
console.log(done.transactionHash);
|
||||
};
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
process.exit(1);
|
||||
});
|
||||
328
src/types/EventAndErrors.ts
Normal file
328
src/types/EventAndErrors.ts
Normal file
@@ -0,0 +1,328 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type { EventFragment } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "./common";
|
||||
|
||||
export interface EventAndErrorsInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
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;
|
||||
"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: "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 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 EventAndErrors extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: EventAndErrorsInterface;
|
||||
|
||||
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: {
|
||||
"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;
|
||||
|
||||
"ReputationUpdated(address)"(
|
||||
reputation?: null
|
||||
): ReputationUpdatedEventFilter;
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: null,
|
||||
merkleRoot?: null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(seller?: null, merkleRoot?: 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: {};
|
||||
|
||||
populateTransaction: {};
|
||||
}
|
||||
211
src/types/Reputation.ts
Normal file
211
src/types/Reputation.ts
Normal file
@@ -0,0 +1,211 @@
|
||||
/* 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 ReputationInterface extends utils.Interface {
|
||||
functions: {
|
||||
"limiter(uint256)": FunctionFragment;
|
||||
"magicValue()": FunctionFragment;
|
||||
"maxLimit()": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "limiter"
|
||||
| "magicValue"
|
||||
| "maxLimit"
|
||||
| "owner"
|
||||
| "setOwner"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "limiter",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "magicValue",
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: ReputationInterface;
|
||||
|
||||
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: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { _spendLimit: BigNumber }>;
|
||||
|
||||
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(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
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>;
|
||||
|
||||
callStatic: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
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: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
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>;
|
||||
};
|
||||
}
|
||||
46
src/types/common.ts
Normal file
46
src/types/common.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Listener } from "@ethersproject/providers";
|
||||
import type { Event, EventFilter } from "ethers";
|
||||
|
||||
export interface TypedEvent<
|
||||
TArgsArray extends Array<any> = any,
|
||||
TArgsObject = any
|
||||
> extends Event {
|
||||
args: TArgsArray & TArgsObject;
|
||||
}
|
||||
|
||||
export interface TypedEventFilter<_TEvent extends TypedEvent>
|
||||
extends EventFilter {}
|
||||
|
||||
export interface TypedListener<TEvent extends TypedEvent> {
|
||||
(...listenerArg: [...__TypechainArgsArray<TEvent>, TEvent]): void;
|
||||
}
|
||||
|
||||
type __TypechainArgsArray<T> = T extends TypedEvent<infer U> ? U : never;
|
||||
|
||||
export interface OnEvent<TRes> {
|
||||
<TEvent extends TypedEvent>(
|
||||
eventFilter: TypedEventFilter<TEvent>,
|
||||
listener: TypedListener<TEvent>
|
||||
): TRes;
|
||||
(eventName: string, listener: Listener): TRes;
|
||||
}
|
||||
|
||||
export type MinEthersFactory<C, ARGS> = {
|
||||
deploy(...a: ARGS[]): Promise<C>;
|
||||
};
|
||||
|
||||
export type GetContractTypeFromFactory<F> = F extends MinEthersFactory<
|
||||
infer C,
|
||||
any
|
||||
>
|
||||
? C
|
||||
: never;
|
||||
|
||||
export type GetARGsTypeFromFactory<F> = F extends MinEthersFactory<any, any>
|
||||
? Parameters<F["deploy"]>
|
||||
: never;
|
||||
|
||||
export type PromiseOrValue<T> = T | Promise<T>;
|
||||
372
src/types/factories/EventAndErrors__factory.ts
Normal file
372
src/types/factories/EventAndErrors__factory.ts
Normal file
@@ -0,0 +1,372 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
EventAndErrors,
|
||||
EventAndErrorsInterface,
|
||||
} from "../EventAndErrors";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "AddressDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AlreadyReleased",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AmountNotAllowed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DepositAlreadyExists",
|
||||
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",
|
||||
},
|
||||
{
|
||||
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: "address",
|
||||
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: "address",
|
||||
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: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
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",
|
||||
},
|
||||
];
|
||||
|
||||
export class EventAndErrors__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): EventAndErrorsInterface {
|
||||
return new utils.Interface(_abi) as EventAndErrorsInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): EventAndErrors {
|
||||
return new Contract(address, _abi, signerOrProvider) as EventAndErrors;
|
||||
}
|
||||
}
|
||||
155
src/types/factories/Reputation__factory.ts
Normal file
155
src/types/factories/Reputation__factory.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
/* 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 { Reputation, ReputationInterface } from "../Reputation";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
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: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_userCredit",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "limiter",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_spendLimit",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "magicValue",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "maxLimit",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
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";
|
||||
|
||||
type ReputationConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: ReputationConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class Reputation__factory extends ContractFactory {
|
||||
constructor(...args: ReputationConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<Reputation> {
|
||||
return super.deploy(overrides || {}) as Promise<Reputation>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): Reputation {
|
||||
return super.attach(address) as Reputation;
|
||||
}
|
||||
override connect(signer: Signer): Reputation__factory {
|
||||
return super.connect(signer) as Reputation__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): ReputationInterface {
|
||||
return new utils.Interface(_abi) as ReputationInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): Reputation {
|
||||
return new Contract(address, _abi, signerOrProvider) as Reputation;
|
||||
}
|
||||
}
|
||||
7
src/types/factories/index.ts
Normal file
7
src/types/factories/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * as lib from "./lib";
|
||||
export * as p2PixSol from "./p2pix.sol";
|
||||
export { EventAndErrors__factory } from "./EventAndErrors__factory";
|
||||
export { Reputation__factory } from "./Reputation__factory";
|
||||
65
src/types/factories/lib/auth/Owned__factory.ts
Normal file
65
src/types/factories/lib/auth/Owned__factory.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type { Owned, OwnedInterface } from "../../../lib/auth/Owned";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
];
|
||||
|
||||
export class Owned__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): OwnedInterface {
|
||||
return new utils.Interface(_abi) as OwnedInterface;
|
||||
}
|
||||
static connect(address: string, signerOrProvider: Signer | Provider): Owned {
|
||||
return new Contract(address, _abi, signerOrProvider) as Owned;
|
||||
}
|
||||
}
|
||||
4
src/types/factories/lib/auth/index.ts
Normal file
4
src/types/factories/lib/auth/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { Owned__factory } from "./Owned__factory";
|
||||
8
src/types/factories/lib/index.ts
Normal file
8
src/types/factories/lib/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * as auth from "./auth";
|
||||
export * as interfaces from "./interfaces";
|
||||
export * as mock from "./mock";
|
||||
export * as tokens from "./tokens";
|
||||
export * as utils from "./utils";
|
||||
45
src/types/factories/lib/interfaces/IReputation__factory.ts
Normal file
45
src/types/factories/lib/interfaces/IReputation__factory.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
IReputation,
|
||||
IReputationInterface,
|
||||
} from "../../../lib/interfaces/IReputation";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_userCredit",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "limiter",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_spendLimit",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class IReputation__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): IReputationInterface {
|
||||
return new utils.Interface(_abi) as IReputationInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): IReputation {
|
||||
return new Contract(address, _abi, signerOrProvider) as IReputation;
|
||||
}
|
||||
}
|
||||
4
src/types/factories/lib/interfaces/index.ts
Normal file
4
src/types/factories/lib/interfaces/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { IReputation__factory } from "./IReputation__factory";
|
||||
4
src/types/factories/lib/mock/index.ts
Normal file
4
src/types/factories/lib/mock/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * as mockTokenSol from "./mockToken.sol";
|
||||
398
src/types/factories/lib/mock/mockToken.sol/MockToken__factory.ts
Normal file
398
src/types/factories/lib/mock/mockToken.sol/MockToken__factory.ts
Normal file
File diff suppressed because one or more lines are too long
4
src/types/factories/lib/mock/mockToken.sol/index.ts
Normal file
4
src/types/factories/lib/mock/mockToken.sol/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { MockToken__factory } from "./MockToken__factory";
|
||||
317
src/types/factories/lib/tokens/ERC20__factory.ts
Normal file
317
src/types/factories/lib/tokens/ERC20__factory.ts
Normal file
@@ -0,0 +1,317 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type { ERC20, ERC20Interface } from "../../../lib/tokens/ERC20";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "spender",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "Approval",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "from",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "to",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "Transfer",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DOMAIN_SEPARATOR",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "allowance",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "spender",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "approve",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "balanceOf",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "decimals",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint8",
|
||||
name: "",
|
||||
type: "uint8",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "name",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "string",
|
||||
name: "",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "nonces",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "address",
|
||||
name: "spender",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "value",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "deadline",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint8",
|
||||
name: "v",
|
||||
type: "uint8",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "r",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "s",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "permit",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "symbol",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "string",
|
||||
name: "",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "totalSupply",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "to",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "transfer",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "from",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "address",
|
||||
name: "to",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "transferFrom",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class ERC20__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): ERC20Interface {
|
||||
return new utils.Interface(_abi) as ERC20Interface;
|
||||
}
|
||||
static connect(address: string, signerOrProvider: Signer | Provider): ERC20 {
|
||||
return new Contract(address, _abi, signerOrProvider) as ERC20;
|
||||
}
|
||||
}
|
||||
4
src/types/factories/lib/tokens/index.ts
Normal file
4
src/types/factories/lib/tokens/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { ERC20__factory } from "./ERC20__factory";
|
||||
174
src/types/factories/lib/utils/Multicall__factory.ts
Normal file
174
src/types/factories/lib/utils/Multicall__factory.ts
Normal file
@@ -0,0 +1,174 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import {
|
||||
Signer,
|
||||
utils,
|
||||
Contract,
|
||||
ContractFactory,
|
||||
PayableOverrides,
|
||||
} from "ethers";
|
||||
import type { Provider, TransactionRequest } from "@ethersproject/providers";
|
||||
import type { PromiseOrValue } from "../../../common";
|
||||
import type {
|
||||
Multicall,
|
||||
MulticallInterface,
|
||||
} from "../../../lib/utils/Multicall";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
stateMutability: "payable",
|
||||
type: "constructor",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "string",
|
||||
name: "reason",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
name: "CallFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
],
|
||||
name: "mtc1",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes[]",
|
||||
name: "",
|
||||
type: "bytes[]",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
],
|
||||
name: "mtc2",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall.Result[]",
|
||||
name: "",
|
||||
type: "tuple[]",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60806040526108ec806100136000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631b57b72f1461003b57806386575ee914610066575b600080fd5b61004e610049366004610438565b610087565b60405161005d93929190610527565b60405180910390f35b610079610074366004610438565b610227565b60405161005d9291906105cb565b600080606043804085848167ffffffffffffffff8111156100aa576100aa610653565b6040519080825280602002602001820160405280156100f057816020015b6040805180820190915260008152606060208201528152602001906001900390816100c85790505b50905060005b82811015610217576000808b8b8481811061011357610113610682565b905060200281019061012591906106b1565b6101339060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168c8c8581811061015b5761015b610682565b905060200281019061016d91906106b1565b61017b90602081019061072c565b604051610189929190610791565b6000604051808303816000865af19150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b509150915060405180604001604052808315158152602001828152508484815181106101f9576101f9610682565b60200260200101819052508261020e906107a1565b925050506100f6565b5092989197509195509350505050565b600060604383838167ffffffffffffffff81111561024757610247610653565b60405190808252806020026020018201604052801561027a57816020015b60608152602001906001900390816102655790505b50905060005b828110156104285760008089898481811061029d5761029d610682565b90506020028101906102af91906106b1565b6102bd9060208101906106ef565b73ffffffffffffffffffffffffffffffffffffffff168a8a858181106102e5576102e5610682565b90506020028101906102f791906106b1565b61030590602081019061072c565b604051610313929190610791565b6000604051808303816000865af19150503d8060008114610350576040519150601f19603f3d011682016040523d82523d6000602084013e610355565b606091505b5091509150816103f7576044815110156103aa576040517fb5e1dc2d00000000000000000000000000000000000000000000000000000000815260206004820152600060248201526044015b60405180910390fd5b600481019050808060200190518101906103c49190610801565b6040517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526004016103a191906108cc565b8084848151811061040a5761040a610682565b60200260200101819052508261041f906107a1565b92505050610280565b50919350909150505b9250929050565b6000806020838503121561044b57600080fd5b823567ffffffffffffffff8082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b8660208260051b850101111561049b57600080fd5b60209290920196919550909350505050565b60005b838110156104c85781810151838201526020016104b0565b838111156104d7576000848401525b50505050565b600081518084526104f58160208601602086016104ad565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060820185835260208581850152604060608186015282865180855260808701915060808160051b880101945083880160005b828110156105bb578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8001845281518051151588528601518688018690526105a8868901826104dd565b975050928501929085019060010161055c565b50949a9950505050505050505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610645577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030184526106338683516104dd565b955092840192908401906001016105f9565b509398975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126106e557600080fd5b9190910192915050565b60006020828403121561070157600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461072557600080fd5b9392505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261076157600080fd5b83018035915067ffffffffffffffff82111561077c57600080fd5b60200191503681900382131561043157600080fd5b8183823760009101908152919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156107fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561081357600080fd5b815167ffffffffffffffff8082111561082b57600080fd5b818401915084601f83011261083f57600080fd5b81518181111561085157610851610653565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561089757610897610653565b816040528281528760208487010111156108b057600080fd5b6108c18360208301602088016104ad565b979650505050505050565b60208152600061072560208301846104dd56fea164736f6c6343000809000a";
|
||||
|
||||
type MulticallConstructorParams =
|
||||
| [signer?: Signer]
|
||||
| ConstructorParameters<typeof ContractFactory>;
|
||||
|
||||
const isSuperArgs = (
|
||||
xs: MulticallConstructorParams
|
||||
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
|
||||
|
||||
export class Multicall__factory extends ContractFactory {
|
||||
constructor(...args: MulticallConstructorParams) {
|
||||
if (isSuperArgs(args)) {
|
||||
super(...args);
|
||||
} else {
|
||||
super(_abi, _bytecode, args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
override deploy(
|
||||
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<Multicall> {
|
||||
return super.deploy(overrides || {}) as Promise<Multicall>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
|
||||
): TransactionRequest {
|
||||
return super.getDeployTransaction(overrides || {});
|
||||
}
|
||||
override attach(address: string): Multicall {
|
||||
return super.attach(address) as Multicall;
|
||||
}
|
||||
override connect(signer: Signer): Multicall__factory {
|
||||
return super.connect(signer) as Multicall__factory;
|
||||
}
|
||||
|
||||
static readonly bytecode = _bytecode;
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): MulticallInterface {
|
||||
return new utils.Interface(_abi) as MulticallInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): Multicall {
|
||||
return new Contract(address, _abi, signerOrProvider) as Multicall;
|
||||
}
|
||||
}
|
||||
31
src/types/factories/lib/utils/ReentrancyGuard__factory.ts
Normal file
31
src/types/factories/lib/utils/ReentrancyGuard__factory.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
ReentrancyGuard,
|
||||
ReentrancyGuardInterface,
|
||||
} from "../../../lib/utils/ReentrancyGuard";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "Reentrancy",
|
||||
type: "error",
|
||||
},
|
||||
];
|
||||
|
||||
export class ReentrancyGuard__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): ReentrancyGuardInterface {
|
||||
return new utils.Interface(_abi) as ReentrancyGuardInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): ReentrancyGuard {
|
||||
return new Contract(address, _abi, signerOrProvider) as ReentrancyGuard;
|
||||
}
|
||||
}
|
||||
5
src/types/factories/lib/utils/index.ts
Normal file
5
src/types/factories/lib/utils/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { Multicall__factory } from "./Multicall__factory";
|
||||
export { ReentrancyGuard__factory } from "./ReentrancyGuard__factory";
|
||||
1173
src/types/factories/p2pix.sol/P2PIX__factory.ts
Normal file
1173
src/types/factories/p2pix.sol/P2PIX__factory.ts
Normal file
File diff suppressed because one or more lines are too long
4
src/types/factories/p2pix.sol/index.ts
Normal file
4
src/types/factories/p2pix.sol/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { P2PIX__factory } from "./P2PIX__factory";
|
||||
114
src/types/hardhat.d.ts
vendored
Normal file
114
src/types/hardhat.d.ts
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { ethers } from "ethers";
|
||||
import {
|
||||
FactoryOptions,
|
||||
HardhatEthersHelpers as HardhatEthersHelpersBase,
|
||||
} from "@nomiclabs/hardhat-ethers/types";
|
||||
|
||||
import * as Contracts from ".";
|
||||
|
||||
declare module "hardhat/types/runtime" {
|
||||
interface HardhatEthersHelpers extends HardhatEthersHelpersBase {
|
||||
getContractFactory(
|
||||
name: "EventAndErrors",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.EventAndErrors__factory>;
|
||||
getContractFactory(
|
||||
name: "Owned",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.Owned__factory>;
|
||||
getContractFactory(
|
||||
name: "IReputation",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.IReputation__factory>;
|
||||
getContractFactory(
|
||||
name: "MockToken",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.MockToken__factory>;
|
||||
getContractFactory(
|
||||
name: "ERC20",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ERC20__factory>;
|
||||
getContractFactory(
|
||||
name: "Multicall",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.Multicall__factory>;
|
||||
getContractFactory(
|
||||
name: "ReentrancyGuard",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.ReentrancyGuard__factory>;
|
||||
getContractFactory(
|
||||
name: "P2PIX",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.P2PIX__factory>;
|
||||
getContractFactory(
|
||||
name: "Reputation",
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<Contracts.Reputation__factory>;
|
||||
|
||||
getContractAt(
|
||||
name: "EventAndErrors",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.EventAndErrors>;
|
||||
getContractAt(
|
||||
name: "Owned",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.Owned>;
|
||||
getContractAt(
|
||||
name: "IReputation",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.IReputation>;
|
||||
getContractAt(
|
||||
name: "MockToken",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.MockToken>;
|
||||
getContractAt(
|
||||
name: "ERC20",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ERC20>;
|
||||
getContractAt(
|
||||
name: "Multicall",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.Multicall>;
|
||||
getContractAt(
|
||||
name: "ReentrancyGuard",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.ReentrancyGuard>;
|
||||
getContractAt(
|
||||
name: "P2PIX",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.P2PIX>;
|
||||
getContractAt(
|
||||
name: "Reputation",
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<Contracts.Reputation>;
|
||||
|
||||
// default types
|
||||
getContractFactory(
|
||||
name: string,
|
||||
signerOrOptions?: ethers.Signer | FactoryOptions
|
||||
): Promise<ethers.ContractFactory>;
|
||||
getContractFactory(
|
||||
abi: any[],
|
||||
bytecode: ethers.utils.BytesLike,
|
||||
signer?: ethers.Signer
|
||||
): Promise<ethers.ContractFactory>;
|
||||
getContractAt(
|
||||
nameOrAbi: string | any[],
|
||||
address: string,
|
||||
signer?: ethers.Signer
|
||||
): Promise<ethers.Contract>;
|
||||
}
|
||||
}
|
||||
26
src/types/index.ts
Normal file
26
src/types/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
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 { Owned } from "./lib/auth/Owned";
|
||||
export { Owned__factory } from "./factories/lib/auth/Owned__factory";
|
||||
export type { IReputation } from "./lib/interfaces/IReputation";
|
||||
export { IReputation__factory } from "./factories/lib/interfaces/IReputation__factory";
|
||||
export type { 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 { 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 { P2PIX } from "./p2pix.sol/P2PIX";
|
||||
export { P2PIX__factory } from "./factories/p2pix.sol/P2PIX__factory";
|
||||
export { Reputation__factory } from "./factories/Reputation__factory";
|
||||
143
src/types/lib/auth/Owned.ts
Normal file
143
src/types/lib/auth/Owned.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
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 OwnedInterface extends utils.Interface {
|
||||
functions: {
|
||||
"owner()": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(nameOrSignatureOrTopic: "owner" | "setOwner"): FunctionFragment;
|
||||
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
|
||||
events: {
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
}
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface Owned extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: OwnedInterface;
|
||||
|
||||
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: {
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
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;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
4
src/types/lib/auth/index.ts
Normal file
4
src/types/lib/auth/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { Owned } from "./Owned";
|
||||
13
src/types/lib/index.ts
Normal file
13
src/types/lib/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type * as auth from "./auth";
|
||||
export type { auth };
|
||||
import type * as interfaces from "./interfaces";
|
||||
export type { interfaces };
|
||||
import type * as mock from "./mock";
|
||||
export type { mock };
|
||||
import type * as tokens from "./tokens";
|
||||
export type { tokens };
|
||||
import type * as utils from "./utils";
|
||||
export type { utils };
|
||||
101
src/types/lib/interfaces/IReputation.ts
Normal file
101
src/types/lib/interfaces/IReputation.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../../common";
|
||||
|
||||
export interface IReputationInterface extends utils.Interface {
|
||||
functions: {
|
||||
"limiter(uint256)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(nameOrSignatureOrTopic: "limiter"): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "limiter",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "limiter", data: BytesLike): Result;
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface IReputation extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: IReputationInterface;
|
||||
|
||||
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: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { _spendLimit: BigNumber }>;
|
||||
};
|
||||
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
callStatic: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
4
src/types/lib/interfaces/index.ts
Normal file
4
src/types/lib/interfaces/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { IReputation } from "./IReputation";
|
||||
5
src/types/lib/mock/index.ts
Normal file
5
src/types/lib/mock/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type * as mockTokenSol from "./mockToken.sol";
|
||||
export type { mockTokenSol };
|
||||
543
src/types/lib/mock/mockToken.sol/MockToken.ts
Normal file
543
src/types/lib/mock/mockToken.sol/MockToken.ts
Normal file
@@ -0,0 +1,543 @@
|
||||
/* 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 MockTokenInterface extends utils.Interface {
|
||||
functions: {
|
||||
"DOMAIN_SEPARATOR()": FunctionFragment;
|
||||
"allowance(address,address)": FunctionFragment;
|
||||
"approve(address,uint256)": FunctionFragment;
|
||||
"balanceOf(address)": FunctionFragment;
|
||||
"decimals()": FunctionFragment;
|
||||
"mint(address[],uint256)": FunctionFragment;
|
||||
"name()": FunctionFragment;
|
||||
"nonces(address)": FunctionFragment;
|
||||
"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment;
|
||||
"symbol()": FunctionFragment;
|
||||
"totalSupply()": FunctionFragment;
|
||||
"transfer(address,uint256)": FunctionFragment;
|
||||
"transferFrom(address,address,uint256)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "DOMAIN_SEPARATOR"
|
||||
| "allowance"
|
||||
| "approve"
|
||||
| "balanceOf"
|
||||
| "decimals"
|
||||
| "mint"
|
||||
| "name"
|
||||
| "nonces"
|
||||
| "permit"
|
||||
| "symbol"
|
||||
| "totalSupply"
|
||||
| "transfer"
|
||||
| "transferFrom"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "DOMAIN_SEPARATOR",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowance",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "approve",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "balanceOf",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "mint",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "name", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "nonces",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "permit",
|
||||
values: [
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BytesLike>
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "totalSupply",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transfer",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transferFrom",
|
||||
values: [
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>
|
||||
]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "DOMAIN_SEPARATOR",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "totalSupply",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "transferFrom",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"Approval(address,address,uint256)": EventFragment;
|
||||
"Transfer(address,address,uint256)": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment;
|
||||
}
|
||||
|
||||
export interface ApprovalEventObject {
|
||||
owner: string;
|
||||
spender: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type ApprovalEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
ApprovalEventObject
|
||||
>;
|
||||
|
||||
export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
|
||||
|
||||
export interface TransferEventObject {
|
||||
from: string;
|
||||
to: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type TransferEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
TransferEventObject
|
||||
>;
|
||||
|
||||
export type TransferEventFilter = TypedEventFilter<TransferEvent>;
|
||||
|
||||
export interface MockToken extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: MockTokenInterface;
|
||||
|
||||
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: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<[number]>;
|
||||
|
||||
mint(
|
||||
to: PromiseOrValue<string>[],
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<number>;
|
||||
|
||||
mint(
|
||||
to: PromiseOrValue<string>[],
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<number>;
|
||||
|
||||
mint(
|
||||
to: PromiseOrValue<string>[],
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"Approval(address,address,uint256)"(
|
||||
owner?: PromiseOrValue<string> | null,
|
||||
spender?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): ApprovalEventFilter;
|
||||
Approval(
|
||||
owner?: PromiseOrValue<string> | null,
|
||||
spender?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): ApprovalEventFilter;
|
||||
|
||||
"Transfer(address,address,uint256)"(
|
||||
from?: PromiseOrValue<string> | null,
|
||||
to?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): TransferEventFilter;
|
||||
Transfer(
|
||||
from?: PromiseOrValue<string> | null,
|
||||
to?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): TransferEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
mint(
|
||||
to: PromiseOrValue<string>[],
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
mint(
|
||||
to: PromiseOrValue<string>[],
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
4
src/types/lib/mock/mockToken.sol/index.ts
Normal file
4
src/types/lib/mock/mockToken.sol/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { MockToken } from "./MockToken";
|
||||
506
src/types/lib/tokens/ERC20.ts
Normal file
506
src/types/lib/tokens/ERC20.ts
Normal file
@@ -0,0 +1,506 @@
|
||||
/* 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 ERC20Interface extends utils.Interface {
|
||||
functions: {
|
||||
"DOMAIN_SEPARATOR()": FunctionFragment;
|
||||
"allowance(address,address)": FunctionFragment;
|
||||
"approve(address,uint256)": FunctionFragment;
|
||||
"balanceOf(address)": FunctionFragment;
|
||||
"decimals()": FunctionFragment;
|
||||
"name()": FunctionFragment;
|
||||
"nonces(address)": FunctionFragment;
|
||||
"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment;
|
||||
"symbol()": FunctionFragment;
|
||||
"totalSupply()": FunctionFragment;
|
||||
"transfer(address,uint256)": FunctionFragment;
|
||||
"transferFrom(address,address,uint256)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "DOMAIN_SEPARATOR"
|
||||
| "allowance"
|
||||
| "approve"
|
||||
| "balanceOf"
|
||||
| "decimals"
|
||||
| "name"
|
||||
| "nonces"
|
||||
| "permit"
|
||||
| "symbol"
|
||||
| "totalSupply"
|
||||
| "transfer"
|
||||
| "transferFrom"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "DOMAIN_SEPARATOR",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowance",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "approve",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "balanceOf",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
|
||||
encodeFunctionData(functionFragment: "name", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "nonces",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "permit",
|
||||
values: [
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BigNumberish>,
|
||||
PromiseOrValue<BytesLike>,
|
||||
PromiseOrValue<BytesLike>
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "totalSupply",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transfer",
|
||||
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transferFrom",
|
||||
values: [
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<string>,
|
||||
PromiseOrValue<BigNumberish>
|
||||
]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "DOMAIN_SEPARATOR",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "totalSupply",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "transferFrom",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"Approval(address,address,uint256)": EventFragment;
|
||||
"Transfer(address,address,uint256)": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment;
|
||||
}
|
||||
|
||||
export interface ApprovalEventObject {
|
||||
owner: string;
|
||||
spender: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type ApprovalEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
ApprovalEventObject
|
||||
>;
|
||||
|
||||
export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
|
||||
|
||||
export interface TransferEventObject {
|
||||
from: string;
|
||||
to: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type TransferEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
TransferEventObject
|
||||
>;
|
||||
|
||||
export type TransferEventFilter = TypedEventFilter<TransferEvent>;
|
||||
|
||||
export interface ERC20 extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: ERC20Interface;
|
||||
|
||||
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: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<[number]>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber]>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<number>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<number>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"Approval(address,address,uint256)"(
|
||||
owner?: PromiseOrValue<string> | null,
|
||||
spender?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): ApprovalEventFilter;
|
||||
Approval(
|
||||
owner?: PromiseOrValue<string> | null,
|
||||
spender?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): ApprovalEventFilter;
|
||||
|
||||
"Transfer(address,address,uint256)"(
|
||||
from?: PromiseOrValue<string> | null,
|
||||
to?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): TransferEventFilter;
|
||||
Transfer(
|
||||
from?: PromiseOrValue<string> | null,
|
||||
to?: PromiseOrValue<string> | null,
|
||||
amount?: null
|
||||
): TransferEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
allowance(
|
||||
arg0: PromiseOrValue<string>,
|
||||
arg1: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
approve(
|
||||
spender: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
balanceOf(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
decimals(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
name(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
nonces(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
permit(
|
||||
owner: PromiseOrValue<string>,
|
||||
spender: PromiseOrValue<string>,
|
||||
value: PromiseOrValue<BigNumberish>,
|
||||
deadline: PromiseOrValue<BigNumberish>,
|
||||
v: PromiseOrValue<BigNumberish>,
|
||||
r: PromiseOrValue<BytesLike>,
|
||||
s: PromiseOrValue<BytesLike>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
symbol(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
totalSupply(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
transfer(
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
transferFrom(
|
||||
from: PromiseOrValue<string>,
|
||||
to: PromiseOrValue<string>,
|
||||
amount: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
4
src/types/lib/tokens/index.ts
Normal file
4
src/types/lib/tokens/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { ERC20 } from "./ERC20";
|
||||
155
src/types/lib/utils/Multicall.ts
Normal file
155
src/types/lib/utils/Multicall.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../../common";
|
||||
|
||||
export declare namespace Multicall {
|
||||
export type CallStruct = {
|
||||
target: PromiseOrValue<string>;
|
||||
callData: PromiseOrValue<BytesLike>;
|
||||
};
|
||||
|
||||
export type CallStructOutput = [string, string] & {
|
||||
target: string;
|
||||
callData: string;
|
||||
};
|
||||
|
||||
export type ResultStruct = {
|
||||
success: PromiseOrValue<boolean>;
|
||||
returnData: PromiseOrValue<BytesLike>;
|
||||
};
|
||||
|
||||
export type ResultStructOutput = [boolean, string] & {
|
||||
success: boolean;
|
||||
returnData: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface MulticallInterface extends utils.Interface {
|
||||
functions: {
|
||||
"mtc1((address,bytes)[])": FunctionFragment;
|
||||
"mtc2((address,bytes)[])": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(nameOrSignatureOrTopic: "mtc1" | "mtc2"): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "mtc1",
|
||||
values: [Multicall.CallStruct[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "mtc2",
|
||||
values: [Multicall.CallStruct[]]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "mtc1", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "mtc2", data: BytesLike): Result;
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface Multicall extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: MulticallInterface;
|
||||
|
||||
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: {
|
||||
mtc1(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
mtc2(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
mtc1(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
mtc2(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
mtc1(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string[]]>;
|
||||
|
||||
mtc2(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string, Multicall.ResultStructOutput[]]>;
|
||||
};
|
||||
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
mtc1(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
mtc2(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
mtc1(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
mtc2(
|
||||
calls: Multicall.CallStruct[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
56
src/types/lib/utils/ReentrancyGuard.ts
Normal file
56
src/types/lib/utils/ReentrancyGuard.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 ReentrancyGuardInterface extends utils.Interface {
|
||||
functions: {};
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface ReentrancyGuard extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: ReentrancyGuardInterface;
|
||||
|
||||
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: {};
|
||||
}
|
||||
5
src/types/lib/utils/index.ts
Normal file
5
src/types/lib/utils/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { Multicall } from "./Multicall";
|
||||
export type { ReentrancyGuard } from "./ReentrancyGuard";
|
||||
1587
src/types/p2pix.sol/P2PIX.ts
Normal file
1587
src/types/p2pix.sol/P2PIX.ts
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user