Compare commits
2 Commits
dev
...
fd7c84f20a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd7c84f20a | ||
|
|
ee470c0393 |
2
.commitlintrc.yaml
Normal file
2
.commitlintrc.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
extends:
|
||||
- "@commitlint/config-conventional"
|
||||
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
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
4
.husky/commit-msg
Executable file
4
.husky/commit-msg
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn dlx commitlint --edit $1
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn dlx lint-staged
|
||||
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"],
|
||||
};
|
||||
|
||||
546
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
546
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
786
.yarn/releases/yarn-3.2.1.cjs
vendored
Executable file
786
.yarn/releases/yarn-3.2.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
942
.yarn/releases/yarn-4.9.2.cjs
vendored
942
.yarn/releases/yarn-4.9.2.cjs
vendored
File diff suppressed because one or more lines are too long
10
.yarnrc.yml
10
.yarnrc.yml
@@ -1,7 +1,7 @@
|
||||
compressionLevel: mixed
|
||||
|
||||
enableGlobalCache: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.9.2.cjs
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.1.cjs
|
||||
|
||||
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/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
61
artifacts/contracts/Reputation.sol/Reputation.json
Normal file
61
artifacts/contracts/Reputation.sol/Reputation.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Reputation",
|
||||
"sourceName": "contracts/Reputation.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"stateMutability": "payable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x6080806040526102c990816100128239f3fe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033",
|
||||
"deployedBytecode": "0x6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/f220dbc6fa6f1dbf5c2cb562d65f0725.json"
|
||||
}
|
||||
686
artifacts/contracts/core/BaseUtils.sol/BaseUtils.json
Normal file
686
artifacts/contracts/core/BaseUtils.sol/BaseUtils.json
Normal file
@@ -0,0 +1,686 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "BaseUtils",
|
||||
"sourceName": "contracts/core/BaseUtils.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AddressDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AmountNotAllowed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EmptyPixTarget",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidDeposit",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSigner",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LengthMismatch",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LockExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LoopOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MaxBalExceeded",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NoTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotEnoughTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlySeller",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Reentrancy",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "StaticCallFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TxAlreadyUsed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "AllowedERC20Updated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "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": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "forwarder",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "TrustedForwarderUpdated",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "_castAddrToKey",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_key",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_key",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "_castKeyToAddr",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20",
|
||||
"name": "erc20",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowedERC20s",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "defaultLockBlocks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "str",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"name": "getStr",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "strEnc",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isTrustedForwarder",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "reputation",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "sellerKey",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sellerAllowList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "setDefaultLockBlocks",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "_reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setReputation",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "forwarders",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "setTrustedFowarders",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_validSigners",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "setValidSigners",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_tokens",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "_states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "tokenSettings",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "message",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "usedTransactions",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "used",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "signer",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "validBacenSigners",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "valid",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "withdrawBalance",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
10
artifacts/contracts/core/Constants.sol/Constants.json
Normal file
10
artifacts/contracts/core/Constants.sol/Constants.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Constants",
|
||||
"sourceName": "contracts/core/Constants.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
10
artifacts/contracts/core/DataTypes.sol/DataTypes.json
Normal file
10
artifacts/contracts/core/DataTypes.sol/DataTypes.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "DataTypes",
|
||||
"sourceName": "contracts/core/DataTypes.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220a40e6f94f4c0b9a9cdd9ac64f98613aece8f5a3f084ee1eca35eba466df9810964736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220a40e6f94f4c0b9a9cdd9ac64f98613aece8f5a3f084ee1eca35eba466df9810964736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
371
artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json
Normal file
371
artifacts/contracts/core/EventAndErrors.sol/EventAndErrors.json
Normal file
@@ -0,0 +1,371 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "EventAndErrors",
|
||||
"sourceName": "contracts/core/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": "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": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "forwarder",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "TrustedForwarderUpdated",
|
||||
"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": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
605
artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json
Normal file
605
artifacts/contracts/core/OwnerSettings.sol/OwnerSettings.json
Normal file
@@ -0,0 +1,605 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "OwnerSettings",
|
||||
"sourceName": "contracts/core/OwnerSettings.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AddressDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AlreadyReleased",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "AmountNotAllowed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DecOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "EmptyPixTarget",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidDeposit",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSigner",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LengthMismatch",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LockExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "LoopOverflow",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "MaxBalExceeded",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NoTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotEnoughTokens",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotExpired",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "NotInitialized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "OnlySeller",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "StaticCallFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TokenDenied",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TxAlreadyUsed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "token",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "AllowedERC20Updated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "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": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "address",
|
||||
"name": "reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "ReputationUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "seller",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "merkleRoot",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RootUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "forwarder",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "TrustedForwarderUpdated",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract ERC20",
|
||||
"name": "erc20",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowedERC20s",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "state",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "defaultLockBlocks",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isTrustedForwarder",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "reputation",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "sellerKey",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "sellerAllowList",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_blocks",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "setDefaultLockBlocks",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "contract IReputation",
|
||||
"name": "_reputation",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setReputation",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "forwarders",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "setTrustedFowarders",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_validSigners",
|
||||
"type": "address[]"
|
||||
}
|
||||
],
|
||||
"name": "setValidSigners",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address[]",
|
||||
"name": "_tokens",
|
||||
"type": "address[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bool[]",
|
||||
"name": "_states",
|
||||
"type": "bool[]"
|
||||
}
|
||||
],
|
||||
"name": "tokenSettings",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "signer",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "validBacenSigners",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "valid",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "withdrawBalance",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
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/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
61
artifacts/contracts/lib/auth/Owned.sol/Owned.json
Normal file
61
artifacts/contracts/lib/auth/Owned.sol/Owned.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Owned",
|
||||
"sourceName": "contracts/lib/auth/Owned.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"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/cd64a64b3749ac90866585a6471cc921.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/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Context",
|
||||
"sourceName": "contracts/lib/metatx/ERC2771Context.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ERC2771Context",
|
||||
"sourceName": "contracts/lib/metatx/ERC2771Context.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isTrustedForwarder",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.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/cd64a64b3749ac90866585a6471cc921.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": {}
|
||||
}
|
||||
4
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json
Normal file
4
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.dbg.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
16
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.json
Normal file
16
artifacts/contracts/lib/utils/ECDSA.sol/ECDSA.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ECDSA",
|
||||
"sourceName": "contracts/lib/utils/ECDSA.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "InvalidSignature",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea26469706673582212201f6fe8a460e1235bb7e19365d8e3cc56b718d44f5db82f5fa3c90d3c7da59ebf64736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "MerkleProofLib",
|
||||
"sourceName": "contracts/lib/utils/MerkleProofLib.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220030f589a2a329a8fd0f451393f1e14e20eb0e1f782beb297fe6aade2ffebc0b564736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220030f589a2a329a8fd0f451393f1e14e20eb0e1f782beb297fe6aade2ffebc0b564736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.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": "0x6080806040526107fb90816100128239f3fe604060808152600436101561001357600080fd5b6000803560e01c9182631b57b72f1461003c5750506386575ee91461003757600080fd5b610362565b3461015e5761004a36610162565b61005e61005982949394610523565b6104df565b928184527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061008c83610523565b01855b81811061013e575050845b8281106100b6578351806100b2874380409084610238565b0390f35b806100cd6100c86101399386866105c7565b61060c565b87806100da8488886105c7565b92816100eb6020958681019061062d565b91906100fb8c518094819361067e565b03925af1906101086106c6565b9061011b6101146104ba565b9315158452565b8201526101288288610755565b526101338187610755565b50610769565b61009a565b6020906101496104ba565b8881528260608183015282890101520161008f565b5080fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101cd5760043567ffffffffffffffff928382116101cd57806023830112156101cd5781600401359384116101cd5760248460051b830101116101cd576024019190565b600080fd5b60005b8381106101e55750506000910152565b81810151838201526020016101d5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610231815180928187528780880191016101d2565b0116010190565b9160608301918352602090818401526040926060848201528451809352608081018260808560051b8401019601946000925b85841061027b575050505050505090565b9091929394959685806102ca837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80866001960301885286838d51805115158452015191818582015201906101f5565b99019401940192959493919061026a565b90604082019082526020604081840152835180925260608301928160608460051b8301019501936000915b8483106103165750505050505090565b9091929394958480610352837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086600196030187528a516101f5565b9801930193019194939290610306565b346101cd5761037036610162565b6103798161053b565b916000805b83811061039457604051806100b28743836102db565b6103a26100c88286866105c7565b82806103bc6103b28589896105c7565b602081019061062d565b82604095926103cf87518094819361067e565b03925af1906103dc6106c6565b918290156103fa575050906103f5916101288288610755565b61037e565b604483929351106104535761042061044f916004809401602480915183010191016106ec565b92519283927fb5e1dc2d0000000000000000000000000000000000000000000000000000000084528301610744565b0390fd5b82517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604490fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051906040820182811067ffffffffffffffff8211176104da57604052565b61048b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176104da57604052565b67ffffffffffffffff81116104da5760051b60200190565b9061054861005983610523565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06105768294610523565b019060005b82811061058757505050565b80606060208093850101520161057b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156106075760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1813603018212156101cd570190565b610598565b3573ffffffffffffffffffffffffffffffffffffffff811681036101cd5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101cd570180359067ffffffffffffffff82116101cd576020019181360383136101cd57565b908092918237016000815290565b67ffffffffffffffff81116104da57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156106e7573d906106da6100598361068c565b9182523d6000602084013e565b606090565b6020818303126101cd5780519067ffffffffffffffff82116101cd570181601f820112156101cd5780516107226100598261068c565b92818452602082840101116101cd5761074191602080850191016101d2565b90565b9060206107419281815201906101f5565b80518210156106075760209160051b010190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212206c86e7cf81738039d37cf5e545b323288faae992e0d08dec8c43f2f2b31f35f664736f6c63430008130033",
|
||||
"deployedBytecode": "0x604060808152600436101561001357600080fd5b6000803560e01c9182631b57b72f1461003c5750506386575ee91461003757600080fd5b610362565b3461015e5761004a36610162565b61005e61005982949394610523565b6104df565b928184527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061008c83610523565b01855b81811061013e575050845b8281106100b6578351806100b2874380409084610238565b0390f35b806100cd6100c86101399386866105c7565b61060c565b87806100da8488886105c7565b92816100eb6020958681019061062d565b91906100fb8c518094819361067e565b03925af1906101086106c6565b9061011b6101146104ba565b9315158452565b8201526101288288610755565b526101338187610755565b50610769565b61009a565b6020906101496104ba565b8881528260608183015282890101520161008f565b5080fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101cd5760043567ffffffffffffffff928382116101cd57806023830112156101cd5781600401359384116101cd5760248460051b830101116101cd576024019190565b600080fd5b60005b8381106101e55750506000910152565b81810151838201526020016101d5565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610231815180928187528780880191016101d2565b0116010190565b9160608301918352602090818401526040926060848201528451809352608081018260808560051b8401019601946000925b85841061027b575050505050505090565b9091929394959685806102ca837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80866001960301885286838d51805115158452015191818582015201906101f5565b99019401940192959493919061026a565b90604082019082526020604081840152835180925260608301928160608460051b8301019501936000915b8483106103165750505050505090565b9091929394958480610352837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086600196030187528a516101f5565b9801930193019194939290610306565b346101cd5761037036610162565b6103798161053b565b916000805b83811061039457604051806100b28743836102db565b6103a26100c88286866105c7565b82806103bc6103b28589896105c7565b602081019061062d565b82604095926103cf87518094819361067e565b03925af1906103dc6106c6565b918290156103fa575050906103f5916101288288610755565b61037e565b604483929351106104535761042061044f916004809401602480915183010191016106ec565b92519283927fb5e1dc2d0000000000000000000000000000000000000000000000000000000084528301610744565b0390fd5b82517fb5e1dc2d0000000000000000000000000000000000000000000000000000000081526020600482015260006024820152604490fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051906040820182811067ffffffffffffffff8211176104da57604052565b61048b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176104da57604052565b67ffffffffffffffff81116104da5760051b60200190565b9061054861005983610523565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06105768294610523565b019060005b82811061058757505050565b80606060208093850101520161057b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b91908110156106075760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1813603018212156101cd570190565b610598565b3573ffffffffffffffffffffffffffffffffffffffff811681036101cd5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156101cd570180359067ffffffffffffffff82116101cd576020019181360383136101cd57565b908092918237016000815290565b67ffffffffffffffff81116104da57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156106e7573d906106da6100598361068c565b9182523d6000602084013e565b606090565b6020818303126101cd5780519067ffffffffffffffff82116101cd570181601f820112156101cd5780516107226100598261068c565b92818452602082840101116101cd5761074191602080850191016101d2565b90565b9060206107419281815201906101f5565b80518210156106075760209160051b010190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107965760010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212206c86e7cf81738039d37cf5e545b323288faae992e0d08dec8c43f2f2b31f35f664736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cd64a64b3749ac90866585a6471cc921.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/cd64a64b3749ac90866585a6471cc921.json"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "SafeTransferLib",
|
||||
"sourceName": "contracts/lib/utils/SafeTransferLib.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "ETHTransferFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TransferFailed",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "TransferFromFailed",
|
||||
"type": "error"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220007e83452e6dfca4997d94ba5608da3c2308815d3239b1810079c74651f15a7464736f6c63430008130033",
|
||||
"deployedBytecode": "0x600080fdfea2646970667358221220007e83452e6dfca4997d94ba5608da3c2308815d3239b1810079c74651f15a7464736f6c63430008130033",
|
||||
"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/f220dbc6fa6f1dbf5c2cb562d65f0725.json"
|
||||
}
|
||||
1123
artifacts/contracts/p2pix.sol/P2PIX.json
Normal file
1123
artifacts/contracts/p2pix.sol/P2PIX.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20, OwnerSettings } from "contracts/core/OwnerSettings.sol";
|
||||
import { ERC20, OwnerSettings } from "./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";
|
||||
import { ECDSA } from "../lib/utils/ECDSA.sol";
|
||||
import { MerkleProofLib as Merkle } from "../lib/utils/MerkleProofLib.sol";
|
||||
import { ReentrancyGuard } from "../lib/utils/ReentrancyGuard.sol";
|
||||
|
||||
abstract contract BaseUtils is
|
||||
OwnerSettings,
|
||||
@@ -20,7 +20,7 @@ abstract contract BaseUtils is
|
||||
|
||||
/// ███ Helper FX ██████████████████████████████████████████████████████████
|
||||
function _setUsedTransactions(bytes32 message) internal {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
sstore(message, true)
|
||||
}
|
||||
}
|
||||
@@ -28,14 +28,16 @@ abstract contract BaseUtils is
|
||||
function usedTransactions(
|
||||
bytes32 message
|
||||
) public view returns (bool used) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
used := sload(message)
|
||||
}
|
||||
}
|
||||
|
||||
function _signerCheck(
|
||||
bytes32 _message,
|
||||
bytes calldata _signature
|
||||
bytes32 _r,
|
||||
bytes32 _s,
|
||||
uint8 _v
|
||||
) internal view {
|
||||
if (usedTransactions(_message))
|
||||
revert TxAlreadyUsed();
|
||||
@@ -43,11 +45,13 @@ abstract contract BaseUtils is
|
||||
if (
|
||||
!validBacenSigners(
|
||||
_castAddrToKey(
|
||||
ECDSA.recoverCalldata(
|
||||
ECDSA.recover(
|
||||
ECDSA.toEthSignedMessageHash(
|
||||
_message
|
||||
),
|
||||
_signature
|
||||
_v,
|
||||
_r,
|
||||
_s
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -71,7 +75,7 @@ abstract contract BaseUtils is
|
||||
function _castBool(
|
||||
bool _valid
|
||||
) internal pure returns (uint256 _validCasted) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
_validCasted := _valid
|
||||
}
|
||||
}
|
||||
@@ -80,7 +84,7 @@ abstract contract BaseUtils is
|
||||
string memory str
|
||||
) public pure returns (bytes32 strEnc) {
|
||||
bytes memory enc = bytes(abi.encodePacked(str));
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
if lt(0x20, mload(enc)) {
|
||||
invalid()
|
||||
}
|
||||
@@ -89,15 +93,15 @@ abstract contract BaseUtils is
|
||||
}
|
||||
|
||||
function _setSellerBalance(
|
||||
address _sellerKey,
|
||||
uint256 _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _packed,
|
||||
bytes32 _pixTarget
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
mstore(0x00, shr(0xc, _sellerKey))
|
||||
let _loc := keccak256(0x0c, 0x34)
|
||||
sstore(add(_loc, 0x01), _packed)
|
||||
sstore(_loc, _pixTarget)
|
||||
@@ -105,55 +109,55 @@ abstract contract BaseUtils is
|
||||
}
|
||||
|
||||
function _setValidState(
|
||||
address _sellerKey,
|
||||
uint256 _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _packed
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
mstore(0x00, shr(0xc, _sellerKey))
|
||||
let _loc := keccak256(0x0c, 0x34)
|
||||
sstore(add(_loc, 0x01), _packed)
|
||||
}
|
||||
}
|
||||
|
||||
function _addSellerBalance(
|
||||
address _sellerKey,
|
||||
uint256 _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _amount
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
mstore(0x00, shr(0xc, _sellerKey))
|
||||
let _loc := add(keccak256(0x0c, 0x34), 0x01)
|
||||
sstore(_loc, add(sload(_loc), _amount))
|
||||
}
|
||||
}
|
||||
|
||||
function _decSellerBalance(
|
||||
address _sellerKey,
|
||||
uint256 _sellerKey,
|
||||
ERC20 _erc20,
|
||||
uint256 _amount
|
||||
) internal {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
mstore(0x00, shr(0xc, _sellerKey))
|
||||
let _loc := add(keccak256(0x0c, 0x34), 0x01)
|
||||
sstore(_loc, sub(sload(_loc), _amount))
|
||||
}
|
||||
}
|
||||
|
||||
function __sellerBalance(
|
||||
address _sellerKey,
|
||||
uint256 _sellerKey,
|
||||
ERC20 _erc20
|
||||
) internal view returns (uint256 _packed) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x20, _erc20)
|
||||
mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
mstore(0x00, _sellerKey)
|
||||
mstore(0x00, shr(0xc, _sellerKey))
|
||||
_packed := sload(add(keccak256(0x0c, 0x34), 0x01))
|
||||
}
|
||||
}
|
||||
@@ -165,7 +169,7 @@ abstract contract BaseUtils is
|
||||
address _addr
|
||||
) public pure returns (uint256 _key) {
|
||||
// _key = uint256(uint160(address(_addr))) << 12;
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
_key := shl(0xc, _addr)
|
||||
}
|
||||
}
|
||||
@@ -174,7 +178,7 @@ abstract contract BaseUtils is
|
||||
uint256 _key
|
||||
) public pure returns (address _addr) {
|
||||
// _addr = address(uint160(uint256(_key >> 12)));
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
_addr := shr(0xc, _key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
abstract contract Constants {
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "contracts/lib/tokens/ERC20.sol";
|
||||
import { ERC20 } from "../lib/tokens/ERC20.sol";
|
||||
|
||||
library DataTypes {
|
||||
|
||||
struct Lock {
|
||||
uint256 sellerKey;
|
||||
uint256 counter;
|
||||
uint256 expirationBlock;
|
||||
bytes32 pixTarget;
|
||||
uint80 amount;
|
||||
ERC20 token;
|
||||
address buyerAddress;
|
||||
address seller;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { ERC20 } from "contracts/lib/tokens/ERC20.sol";
|
||||
import { ERC20 } from "../lib/tokens/ERC20.sol";
|
||||
|
||||
// prettier-ignore
|
||||
interface EventAndErrors {
|
||||
@@ -30,7 +30,7 @@ interface EventAndErrors {
|
||||
event LockAdded(
|
||||
address indexed buyer,
|
||||
uint256 indexed lockID,
|
||||
address seller,
|
||||
uint256 seller,
|
||||
uint256 amount
|
||||
);
|
||||
/// @dev 0x364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
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";
|
||||
import { ERC2771Context as ERC2771 } from "../lib/metatx/ERC2771Context.sol";
|
||||
import { ERC20, SafeTransferLib } from "../lib/utils/SafeTransferLib.sol";
|
||||
import { IReputation } from "../lib/interfaces/IReputation.sol";
|
||||
import { EventAndErrors } from "./EventAndErrors.sol";
|
||||
import { Constants } from "./Constants.sol";
|
||||
import { Owned } from "../lib/auth/Owned.sol";
|
||||
|
||||
abstract contract OwnerSettings is
|
||||
Constants,
|
||||
@@ -46,7 +46,7 @@ abstract contract OwnerSettings is
|
||||
address[] memory forwarders,
|
||||
bool[] memory states
|
||||
) external onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
// first 32 bytes eq to array's length
|
||||
let fLen := mload(forwarders)
|
||||
// halts execution if forwarders.length eq 0
|
||||
@@ -67,7 +67,7 @@ abstract contract OwnerSettings is
|
||||
sLoc := add(sLoc, 0x20)
|
||||
} {
|
||||
// cache hashmap entry in scratch space
|
||||
mstore(0x20, trustedForwarders.slot)
|
||||
mstore(0x20, isTrustedForwarder.slot)
|
||||
mstore(0x00, mload(fLoc))
|
||||
// let mapSlot := keccak256(0x00, 0x40)
|
||||
sstore(keccak256(0x00, 0x40), mload(sLoc))
|
||||
@@ -95,7 +95,7 @@ abstract contract OwnerSettings is
|
||||
function setReputation(
|
||||
IReputation _reputation
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
sstore(reputation.slot, _reputation)
|
||||
}
|
||||
emit ReputationUpdated(address(_reputation));
|
||||
@@ -104,7 +104,7 @@ abstract contract OwnerSettings is
|
||||
function setDefaultLockBlocks(
|
||||
uint256 _blocks
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
sstore(defaultLockBlocks.slot, _blocks)
|
||||
}
|
||||
emit LockBlocksUpdated(_blocks);
|
||||
@@ -113,7 +113,7 @@ abstract contract OwnerSettings is
|
||||
function setValidSigners(
|
||||
address[] memory _validSigners
|
||||
) public onlyOwner {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
let i := add(_validSigners, 0x20)
|
||||
let end := add(i, shl(0x05, mload(_validSigners)))
|
||||
for {
|
||||
@@ -121,7 +121,7 @@ abstract contract OwnerSettings is
|
||||
} iszero(returndatasize()) {
|
||||
/* */
|
||||
} {
|
||||
sstore(shl(0xc, mload(i)), true)
|
||||
sstore(shl(12, mload(i)), true)
|
||||
i := add(i, 0x20)
|
||||
|
||||
if iszero(lt(i, end)) {
|
||||
@@ -137,7 +137,7 @@ abstract contract OwnerSettings is
|
||||
bool[] memory _states
|
||||
) public onlyOwner {
|
||||
/* Yul Impl */
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
// first 32 bytes eq to array's length
|
||||
let tLen := mload(_tokens)
|
||||
// NoTokens()
|
||||
@@ -181,17 +181,17 @@ abstract contract OwnerSettings is
|
||||
function validBacenSigners(
|
||||
uint256 signer
|
||||
) public view returns (bool valid) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
valid := sload(signer)
|
||||
}
|
||||
}
|
||||
|
||||
function sellerAllowList(
|
||||
address sellerKey
|
||||
uint256 sellerKey
|
||||
) public view returns (bytes32 root) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x0c, _SELLER_ALLOWLIST_SLOT_SEED)
|
||||
mstore(0x00, sellerKey)
|
||||
mstore(0x00, shr(12, sellerKey))
|
||||
root := sload(keccak256(0x00, 0x20))
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ abstract contract OwnerSettings is
|
||||
function allowedERC20s(
|
||||
ERC20 erc20
|
||||
) public view returns (bool state) {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
mstore(0x0c, _ALLOWED_ERC20_SLOT_SEED)
|
||||
mstore(0x00, erc20)
|
||||
state := sload(keccak256(0x0c, 0x20))
|
||||
@@ -215,10 +215,10 @@ abstract contract OwnerSettings is
|
||||
_userCredit
|
||||
);
|
||||
bool success;
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
success := staticcall(
|
||||
// gas
|
||||
gas(),
|
||||
0x7530,
|
||||
// address
|
||||
sload(reputation.slot),
|
||||
// argsOffset
|
||||
|
||||
@@ -39,7 +39,7 @@ abstract contract Context {
|
||||
/// @dev Context variant with ERC2771 support.
|
||||
abstract contract ERC2771Context is Context {
|
||||
// address private immutable _trustedForwarder;
|
||||
mapping(address => bool) public trustedForwarders;
|
||||
mapping(address => bool) public isTrustedForwarder;
|
||||
|
||||
/// @custom:oz-upgrades-unsafe-allow constructor
|
||||
// constructor(address trustedForwarder) {
|
||||
@@ -53,7 +53,7 @@ abstract contract ERC2771Context is Context {
|
||||
override
|
||||
returns (address sender)
|
||||
{
|
||||
if (trustedForwarders[msg.sender]) {
|
||||
if (isTrustedForwarder[msg.sender]) {
|
||||
// The assembly code is more direct than the Solidity version using `abi.decode`.
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
@@ -67,8 +67,15 @@ abstract contract ERC2771Context is Context {
|
||||
}
|
||||
}
|
||||
|
||||
function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
|
||||
return trustedForwarders[forwarder];
|
||||
function _isTrustedForwarder()
|
||||
internal
|
||||
view
|
||||
returns (address _sender, uint256 _forwarder)
|
||||
{
|
||||
_sender = _msgSender();
|
||||
_forwarder = (_sender != msg.sender)
|
||||
? uint256(1)
|
||||
: uint256(0);
|
||||
}
|
||||
|
||||
function _msgData()
|
||||
@@ -78,7 +85,7 @@ abstract contract ERC2771Context is Context {
|
||||
override
|
||||
returns (bytes calldata)
|
||||
{
|
||||
if (isTrustedForwarder(msg.sender)) {
|
||||
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.19;
|
||||
|
||||
import { ERC20 } from "../tokens/ERC20.sol";
|
||||
|
||||
|
||||
@@ -15,43 +15,26 @@ library ECDSA {
|
||||
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(
|
||||
/// and the signature defined by `v`, `r`, `s`.
|
||||
function recover(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) internal view returns (address result) {
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
// Copy the free memory pointer so that we can restore it later.
|
||||
let m := mload(0x40)
|
||||
// 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))
|
||||
)
|
||||
)
|
||||
mstore(0x20, and(v, 0xff))
|
||||
mstore(0x40, r)
|
||||
mstore(0x60, s)
|
||||
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`.
|
||||
// If `s` in lower half order, such that the signature is not malleable.
|
||||
lt(s, add(_MALLEABILITY_THRESHOLD, 1)), // Address of `ecrecover`.
|
||||
0x00, // Start of input.
|
||||
0x80, // Size of input.
|
||||
0x00, // Start of output.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
/// ______ __
|
||||
/// .-----.|__ |.-----.|__|.--.--.
|
||||
@@ -8,9 +8,9 @@ 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 { OwnerSettings, ERC20, SafeTransferLib } from "./core/OwnerSettings.sol";
|
||||
import { BaseUtils } from "./core/BaseUtils.sol";
|
||||
import { DataTypes as DT } from "./core/DataTypes.sol";
|
||||
|
||||
|
||||
contract P2PIX is BaseUtils {
|
||||
@@ -21,6 +21,8 @@ contract P2PIX is BaseUtils {
|
||||
using DT for DT.Lock;
|
||||
using DT for DT.LockStatus;
|
||||
|
||||
/// ███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
uint256 public lockCounter;
|
||||
|
||||
/// @dev List of Locks.
|
||||
@@ -28,6 +30,8 @@ contract P2PIX is BaseUtils {
|
||||
/// @dev Stores an relayer's last computed credit.
|
||||
mapping(uint256 => uint256) public userRecord;
|
||||
|
||||
/// ███ Constructor ████████████████████████████████████████████████████████
|
||||
|
||||
constructor(
|
||||
uint256 defaultBlocks,
|
||||
address[] memory validSigners,
|
||||
@@ -44,60 +48,69 @@ contract P2PIX is BaseUtils {
|
||||
)
|
||||
payable {/* */}
|
||||
|
||||
/// ███ 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
|
||||
) public nonReentrant {
|
||||
ERC20 _token,
|
||||
uint96 _amount,
|
||||
string memory _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 (bytes(_pixTarget).length == 0) revert EmptyPixTarget();
|
||||
if (!allowedERC20s(t)) revert TokenDenied();
|
||||
uint256 _sellerBalance = __sellerBalance(k,t);
|
||||
|
||||
uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY;
|
||||
uint256 _newBal = uint256(currBal + amount);
|
||||
uint256 _newBal = uint256(currBal + _amount);
|
||||
if (_newBal > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
setReentrancyGuard();
|
||||
|
||||
if (allowlistRoot != 0) {
|
||||
setRoot(msg.sender, allowlistRoot);
|
||||
}
|
||||
|
||||
bytes32 pixTargetCasted = getStr(pixTarget);
|
||||
uint256 validCasted = _castBool(valid);
|
||||
bytes32 pixTargetCasted = getStr(_pixTarget);
|
||||
uint256 validCasted = _castBool(_valid);
|
||||
|
||||
_setSellerBalance(
|
||||
msg.sender,
|
||||
token,
|
||||
k,
|
||||
t,
|
||||
(_newBal | (validCasted << BITPOS_VALID)),
|
||||
pixTargetCasted
|
||||
);
|
||||
|
||||
SafeTransferLib.safeTransferFrom(
|
||||
token,
|
||||
t,
|
||||
msg.sender,
|
||||
address(this),
|
||||
amount
|
||||
_amount
|
||||
);
|
||||
|
||||
emit DepositAdded(msg.sender, token, amount);
|
||||
clearReentrancyGuard();
|
||||
|
||||
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);
|
||||
@@ -106,7 +119,7 @@ contract P2PIX is BaseUtils {
|
||||
(_sellerBalance & BITMASK_SB_ENTRY) |
|
||||
(_valid << BITPOS_VALID);
|
||||
|
||||
_setValidState(msg.sender, token, _sellerBalance);
|
||||
_setValidState(key, token, _sellerBalance);
|
||||
|
||||
emit ValidSet(msg.sender, token, state);
|
||||
} else revert NotInitialized();
|
||||
@@ -114,92 +127,89 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
/// @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 _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,
|
||||
ERC20 _token,
|
||||
uint80 _amount,
|
||||
bytes32[] calldata merkleProof,
|
||||
uint256[] calldata expiredLocks
|
||||
) public nonReentrant returns (uint256 lockID) {
|
||||
unlockExpired(expiredLocks);
|
||||
|
||||
if (!getValid(seller, token)) revert InvalidDeposit();
|
||||
ERC20 t = _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);
|
||||
address sender; uint256 forwarder;
|
||||
(sender, forwarder) = _isTrustedForwarder();
|
||||
|
||||
// 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());
|
||||
_merkleVerify( merkleProof, sellerAllowList(k), msg.sender);
|
||||
|
||||
} else if ( amount > REPUTATION_LOWERBOUND && msg.sender == _msgSender() ) {
|
||||
} else if (_amount > REPUTATION_LOWERBOUND && forwarder == 0) {
|
||||
|
||||
uint256 spendLimit; uint256 userCredit =
|
||||
userRecord[_castAddrToKey(_msgSender())];
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
uint256 userCredit = userRecord[_castAddrToKey(msg.sender)];
|
||||
uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD);
|
||||
if (
|
||||
amount > (spendLimit * WAD) ||
|
||||
amount > LOCKAMOUNT_UPPERBOUND
|
||||
_amount > (spendLimit * WAD) || _amount > LOCKAMOUNT_UPPERBOUND
|
||||
) revert AmountNotAllowed();
|
||||
}
|
||||
|
||||
DT.Lock memory l = DT.Lock(
|
||||
lockID,
|
||||
k,
|
||||
cCounter,
|
||||
(block.number + defaultLockBlocks),
|
||||
_pixTarget,
|
||||
amount,
|
||||
token,
|
||||
_msgSender(),
|
||||
seller
|
||||
getPixTarget(_seller, t),
|
||||
_amount,
|
||||
t,
|
||||
sender
|
||||
);
|
||||
|
||||
_addLock(bal, l);
|
||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||
}
|
||||
|
||||
/// @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
|
||||
/// @dev `relayerPremium` gets splitted equaly
|
||||
/// if relayer addresses differ.
|
||||
/// @notice If the `msg.sender` of this method and `l.relayerAddress` are the same,
|
||||
/// @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
|
||||
/// @dev Function sighash: 0x4e1389ed.
|
||||
function release(
|
||||
uint256 lockID,
|
||||
bytes32 pixTimestamp,
|
||||
bytes calldata signature
|
||||
bytes32 r,
|
||||
bytes32 s,
|
||||
uint8 v
|
||||
) public nonReentrant {
|
||||
DT.Lock storage l = mapLocks[lockID];
|
||||
|
||||
@@ -215,7 +225,7 @@ contract P2PIX is BaseUtils {
|
||||
)
|
||||
);
|
||||
|
||||
_signerCheck(message, signature);
|
||||
_signerCheck(message, r, s, v);
|
||||
|
||||
ERC20 t = ERC20(l.token);
|
||||
|
||||
@@ -225,8 +235,11 @@ contract P2PIX is BaseUtils {
|
||||
l.amount = 0;
|
||||
l.expirationBlock = 0;
|
||||
_setUsedTransactions(message);
|
||||
|
||||
address sender; uint256 forwarder;
|
||||
(sender, forwarder) = _isTrustedForwarder();
|
||||
|
||||
if (_msgSender() == msg.sender) {
|
||||
if (forwarder == 0) {
|
||||
if (msg.sender != l.buyerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += (lockAmount >> 1);
|
||||
userRecord[_castAddrToKey(l.buyerAddress)] += (lockAmount >> 1);
|
||||
@@ -244,11 +257,11 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
|
||||
/// @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
|
||||
{
|
||||
@@ -261,12 +274,12 @@ contract P2PIX is BaseUtils {
|
||||
_notExpired(l);
|
||||
|
||||
uint256 _sellerBalance =
|
||||
__sellerBalance(l.seller, l.token) & BITMASK_SB_ENTRY;
|
||||
__sellerBalance(l.sellerKey, l.token) & BITMASK_SB_ENTRY;
|
||||
|
||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
_addSellerBalance(l.seller, l.token, l.amount);
|
||||
_addSellerBalance(l.sellerKey, l.token, l.amount);
|
||||
|
||||
l.amount = 0;
|
||||
|
||||
@@ -288,7 +301,7 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
if lt(i, locksSize) {
|
||||
// LoopOverflow()
|
||||
mstore(0x00, 0xdfb035c9)
|
||||
@@ -298,9 +311,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,
|
||||
@@ -311,11 +324,12 @@ contract P2PIX is BaseUtils {
|
||||
if (getValid(msg.sender, token))
|
||||
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
|
||||
@@ -335,7 +349,7 @@ contract P2PIX is BaseUtils {
|
||||
function setRoot(address addr, bytes32 merkleroot)
|
||||
public
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
// if (addr != msg.sender)
|
||||
if iszero(eq(addr, caller())) {
|
||||
// revert OnlySeller()
|
||||
@@ -358,12 +372,15 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/// ███ 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();
|
||||
@@ -372,16 +389,22 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
function _addLock(
|
||||
uint256 _bal,
|
||||
DT.Lock memory _l
|
||||
) internal {
|
||||
mapLocks[_l.counter] = _l;
|
||||
uint256 _amount,
|
||||
uint256 _lockID,
|
||||
DT.Lock memory _l,
|
||||
ERC20 _t,
|
||||
uint256 _k
|
||||
) internal returns(uint256 counter){
|
||||
mapLocks[_lockID] = _l;
|
||||
|
||||
_decBal(_bal, _l.amount, ERC20(_l.token), _l.seller);
|
||||
_decBal(_bal, _amount, _t, _k);
|
||||
++lockCounter;
|
||||
counter = _lockID;
|
||||
|
||||
emit LockAdded(
|
||||
_l.buyerAddress,
|
||||
_l.counter,
|
||||
_l.seller,
|
||||
_lockID,
|
||||
_l.sellerKey,
|
||||
_l.amount
|
||||
);
|
||||
}
|
||||
@@ -390,9 +413,9 @@ contract P2PIX is BaseUtils {
|
||||
uint256 _bal,
|
||||
uint256 _amount,
|
||||
ERC20 _t,
|
||||
address _k
|
||||
uint256 _k
|
||||
) private {
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
if iszero(
|
||||
iszero(
|
||||
or(
|
||||
@@ -416,7 +439,7 @@ contract P2PIX is BaseUtils {
|
||||
view
|
||||
returns (uint256 bal)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
@@ -439,7 +462,7 @@ contract P2PIX is BaseUtils {
|
||||
view
|
||||
returns (bool valid)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
@@ -465,7 +488,7 @@ contract P2PIX is BaseUtils {
|
||||
view
|
||||
returns (bytes32 pixTarget)
|
||||
{
|
||||
assembly ("memory-safe") {
|
||||
assembly {
|
||||
for {
|
||||
/* */
|
||||
} iszero(returndatasize()) {
|
||||
@@ -504,7 +527,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
|
||||
@@ -527,7 +550,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;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"signers": [
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
||||
"0x8963E134E6d22Ee9A26ac62a99964aB391ead816"
|
||||
],
|
||||
"token": "0xfE841c74250e57640390f46d914C88d22C51e82e",
|
||||
"p2pix": "0x57Dcba05980761169508886eEdc6f5E7EC0411Dc"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"signers": [
|
||||
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
||||
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
||||
],
|
||||
"p2pix": "0xb7cD135F5eFD9760981e02E2a898790b688939fe",
|
||||
"token": "0x3eBE67A2C7bdB2081CBd34ba3281E90377462289"
|
||||
}
|
||||
1
docs/DataTypes.md
Normal file
1
docs/DataTypes.md
Normal file
@@ -0,0 +1 @@
|
||||
# DataTypes
|
||||
264
docs/EventAndErrors.md
Normal file
264
docs/EventAndErrors.md
Normal file
@@ -0,0 +1,264 @@
|
||||
# EventAndErrors
|
||||
|
||||
## Events
|
||||
|
||||
### AllowedERC20Updated
|
||||
|
||||
```solidity
|
||||
event AllowedERC20Updated(address indexed token, bool indexed state)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| token `indexed` | address | undefined |
|
||||
| state `indexed` | bool | undefined |
|
||||
|
||||
### DepositAdded
|
||||
|
||||
```solidity
|
||||
event DepositAdded(address indexed seller, uint256 depositID, address token, uint256 amount)
|
||||
```
|
||||
|
||||
███ Events ████████████████████████████████████████████████████████████
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| token | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### DepositClosed
|
||||
|
||||
```solidity
|
||||
event DepositClosed(address indexed seller, uint256 depositID)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
|
||||
### DepositWithdrawn
|
||||
|
||||
```solidity
|
||||
event DepositWithdrawn(address indexed seller, uint256 depositID, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### FundsWithdrawn
|
||||
|
||||
```solidity
|
||||
event FundsWithdrawn(address owner, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| owner | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### LockAdded
|
||||
|
||||
```solidity
|
||||
event LockAdded(address indexed buyer, bytes32 indexed lockID, uint256 depositID, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockID `indexed` | bytes32 | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### LockBlocksUpdated
|
||||
|
||||
```solidity
|
||||
event LockBlocksUpdated(uint256 blocks)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| blocks | uint256 | undefined |
|
||||
|
||||
### LockReleased
|
||||
|
||||
```solidity
|
||||
event LockReleased(address indexed buyer, bytes32 lockId)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockId | bytes32 | undefined |
|
||||
|
||||
### LockReturned
|
||||
|
||||
```solidity
|
||||
event LockReturned(address indexed buyer, bytes32 lockId)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockId | bytes32 | undefined |
|
||||
|
||||
### ReputationUpdated
|
||||
|
||||
```solidity
|
||||
event ReputationUpdated(address reputation)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------- | ------- | ----------- |
|
||||
| reputation | address | undefined |
|
||||
|
||||
### ValidSignersUpdated
|
||||
|
||||
```solidity
|
||||
event ValidSignersUpdated(address[] signers)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | --------- | ----------- |
|
||||
| signers | address[] | undefined |
|
||||
|
||||
## Errors
|
||||
|
||||
### AddressDenied
|
||||
|
||||
```solidity
|
||||
error AddressDenied()
|
||||
```
|
||||
|
||||
_Address doesn't exist in a MerkleTree.Address not allowed as relayer.0x3b8474be_
|
||||
|
||||
### AlreadyReleased
|
||||
|
||||
```solidity
|
||||
error AlreadyReleased()
|
||||
```
|
||||
|
||||
_Lock already released or returned.0x63b4904e_
|
||||
|
||||
### AmountNotAllowed
|
||||
|
||||
```solidity
|
||||
error AmountNotAllowed()
|
||||
```
|
||||
|
||||
_Wished amount to be locked exceeds the limit allowed.0x1c18f846_
|
||||
|
||||
### DepositAlreadyExists
|
||||
|
||||
```solidity
|
||||
error DepositAlreadyExists()
|
||||
```
|
||||
|
||||
_Deposit already exist and it is still valid.0xc44bd765_
|
||||
|
||||
### InvalidDeposit
|
||||
|
||||
```solidity
|
||||
error InvalidDeposit()
|
||||
```
|
||||
|
||||
_Deposit not valid anymore.0xb2e532de_
|
||||
|
||||
### InvalidSigner
|
||||
|
||||
```solidity
|
||||
error InvalidSigner()
|
||||
```
|
||||
|
||||
_Signer is not a valid signer.0x815e1d64_
|
||||
|
||||
### LengthMismatch
|
||||
|
||||
```solidity
|
||||
error LengthMismatch()
|
||||
```
|
||||
|
||||
_Arrays' length don't match.0xff633a38_
|
||||
|
||||
### LoopOverflow
|
||||
|
||||
```solidity
|
||||
error LoopOverflow()
|
||||
```
|
||||
|
||||
_Loop bounds have overflowed.0xdfb035c9_
|
||||
|
||||
### NoTokens
|
||||
|
||||
```solidity
|
||||
error NoTokens()
|
||||
```
|
||||
|
||||
_No tokens array provided as argument.0xdf957883_
|
||||
|
||||
### NotEnoughTokens
|
||||
|
||||
```solidity
|
||||
error NotEnoughTokens()
|
||||
```
|
||||
|
||||
_Not enough token remaining on deposit.0x22bbb43c_
|
||||
|
||||
### NotExpired
|
||||
|
||||
```solidity
|
||||
error NotExpired()
|
||||
```
|
||||
|
||||
_Lock not expired or already released.Another lock with same ID is not expired yet.0xd0404f85_
|
||||
|
||||
### OnlySeller
|
||||
|
||||
```solidity
|
||||
error OnlySeller()
|
||||
```
|
||||
|
||||
_Only seller could call this function.`msg.sender` and the seller differ.0x85d1f726_
|
||||
|
||||
### TokenDenied
|
||||
|
||||
```solidity
|
||||
error TokenDenied()
|
||||
```
|
||||
|
||||
_Token address not allowed to be deposited.0x1578328e_
|
||||
|
||||
### TxAlreadyUsed
|
||||
|
||||
```solidity
|
||||
error TxAlreadyUsed()
|
||||
```
|
||||
|
||||
_Transaction already used to unlock payment.0xf490a6ea_
|
||||
694
docs/P2PIX.md
Normal file
694
docs/P2PIX.md
Normal file
@@ -0,0 +1,694 @@
|
||||
# P2PIX
|
||||
|
||||
## Methods
|
||||
|
||||
### \_castAddrToKey
|
||||
|
||||
```solidity
|
||||
function _castAddrToKey(address _addr) external pure returns (uint256 _key)
|
||||
```
|
||||
|
||||
Public method that handles `address` to `uint256` safe type casting.
|
||||
|
||||
_Function sighash: 0x4b2ae980._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| \_addr | address | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----- | ------- | ----------- |
|
||||
| \_key | uint256 | undefined |
|
||||
|
||||
### allowedERC20s
|
||||
|
||||
```solidity
|
||||
function allowedERC20s(contract ERC20) external view returns (bool)
|
||||
```
|
||||
|
||||
_Tokens allowed to serve as the underlying amount of a deposit._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | -------------- | ----------- |
|
||||
| \_0 | contract ERC20 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| \_0 | bool | undefined |
|
||||
|
||||
### cancelDeposit
|
||||
|
||||
```solidity
|
||||
function cancelDeposit(uint256 depositID) external nonpayable
|
||||
```
|
||||
|
||||
Enables seller to invalidate future locks made to his/her token offering order.
|
||||
|
||||
_This function does not affect any ongoing active locks.Function sighash: 0x72fada5c._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------- | ------- | ----------- |
|
||||
| depositID | uint256 | undefined |
|
||||
|
||||
### defaultLockBlocks
|
||||
|
||||
```solidity
|
||||
function defaultLockBlocks() external view returns (uint256)
|
||||
```
|
||||
|
||||
_Default blocks that lock will hold tokens._
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### deposit
|
||||
|
||||
```solidity
|
||||
function deposit(address _token, uint256 _amount, string _pixTarget, bytes32 allowlistRoot) external nonpayable returns (uint256 depositID)
|
||||
```
|
||||
|
||||
Creates a deposit order based on a seller's offer of an amount of ERC20 tokens.
|
||||
|
||||
_Seller needs to send his tokens to the P2PIX smart contract.Function sighash: 0xbfe07da6._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- | ------- | ------------------------------------------------------- |
|
||||
| \_token | address | undefined |
|
||||
| \_amount | uint256 | undefined |
|
||||
| \_pixTarget | string | Pix key destination provided by the offer's seller. |
|
||||
| allowlistRoot | bytes32 | Optional allow list merkleRoot update `bytes32` value. |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------- | ------- | -------------------------------------------------------------- |
|
||||
| depositID | uint256 | The `uint256` return value provided as the deposit identifier. |
|
||||
|
||||
### depositCount
|
||||
|
||||
```solidity
|
||||
function depositCount() external view returns (uint256 _val)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----- | ------- | ----------- |
|
||||
| \_val | uint256 | undefined |
|
||||
|
||||
### lock
|
||||
|
||||
```solidity
|
||||
function lock(uint256 _depositID, address _buyerAddress, address _relayerTarget, uint256 _relayerPremium, uint256 _amount, bytes32[] merkleProof, bytes32[] expiredLocks) external nonpayable returns (bytes32 lockID)
|
||||
```
|
||||
|
||||
Public method designed to lock an remaining amount of the deposit order of a seller.
|
||||
|
||||
_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; There can only exist a lock per each `_amount` partitioned from the total `remaining` value.Locks can only be performed in valid orders.Function sighash: 0x03aaf306._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| \_depositID | uint256 | undefined |
|
||||
| \_buyerAddress | address | The address of the buyer of a `_depositID`. |
|
||||
| \_relayerTarget | address | Target address entitled to the `relayerPremim`. |
|
||||
| \_relayerPremium | uint256 | The refund/premium owed to a relayer. |
|
||||
| \_amount | uint256 | The deposit's remaining amount wished to be locked. |
|
||||
| merkleProof | bytes32[] | This value should be: - Provided as a pass if the `msg.sender` is in the seller's allowlist; - Left empty otherwise; |
|
||||
| expiredLocks | bytes32[] | An array of `bytes32` identifiers to be provided so to unexpire locks using this transaction gas push. |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ---------------------------------------------------- |
|
||||
| lockID | bytes32 | The `bytes32` value returned as the lock identifier. |
|
||||
|
||||
### mapDeposits
|
||||
|
||||
```solidity
|
||||
function mapDeposits(uint256) external view returns (uint256 remaining, string pixTarget, address seller, address token, bool valid)
|
||||
```
|
||||
|
||||
_Seller list of deposits_
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------- | ------- | ----------- |
|
||||
| remaining | uint256 | undefined |
|
||||
| pixTarget | string | undefined |
|
||||
| seller | address | undefined |
|
||||
| token | address | undefined |
|
||||
| valid | bool | undefined |
|
||||
|
||||
### mapLocks
|
||||
|
||||
```solidity
|
||||
function mapLocks(bytes32) external view returns (uint256 depositID, uint256 relayerPremium, uint256 amount, uint256 expirationBlock, address buyerAddress, address relayerTarget, address relayerAddress)
|
||||
```
|
||||
|
||||
_List of Locks._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | bytes32 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| depositID | uint256 | undefined |
|
||||
| relayerPremium | uint256 | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
| expirationBlock | uint256 | undefined |
|
||||
| buyerAddress | address | undefined |
|
||||
| relayerTarget | address | undefined |
|
||||
| relayerAddress | address | undefined |
|
||||
|
||||
### owner
|
||||
|
||||
```solidity
|
||||
function owner() external view returns (address)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | address | undefined |
|
||||
|
||||
### release
|
||||
|
||||
```solidity
|
||||
function release(bytes32 lockID, address _relayerTarget, uint256 pixTimestamp, bytes32 r, bytes32 s, uint8 v) external nonpayable
|
||||
```
|
||||
|
||||
Lock release method that liquidate lock orders and distributes relayer fees.
|
||||
|
||||
_This method can be called by any public actor as long the signature provided is valid.`relayerPremium` gets splitted equaly if `relayerTarget` addresses differ.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; Function sighash: 0x4e1389ed._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------------------------------------------- |
|
||||
| lockID | bytes32 | undefined |
|
||||
| \_relayerTarget | address | Target address entitled to the `relayerPremim`. |
|
||||
| pixTimestamp | uint256 | undefined |
|
||||
| r | bytes32 | undefined |
|
||||
| s | bytes32 | undefined |
|
||||
| v | uint8 | undefined |
|
||||
|
||||
### reputation
|
||||
|
||||
```solidity
|
||||
function reputation() external view returns (contract IReputation)
|
||||
```
|
||||
|
||||
███ Storage ████████████████████████████████████████████████████████████
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | -------------------- | ----------- |
|
||||
| \_0 | contract IReputation | undefined |
|
||||
|
||||
### sellerAllowList
|
||||
|
||||
```solidity
|
||||
function sellerAllowList(uint256) external view returns (bytes32)
|
||||
```
|
||||
|
||||
_Seller casted to key => Seller's allowlist merkleroot._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | bytes32 | undefined |
|
||||
|
||||
### setDefaultLockBlocks
|
||||
|
||||
```solidity
|
||||
function setDefaultLockBlocks(uint256 _blocks) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| \_blocks | uint256 | undefined |
|
||||
|
||||
### setOwner
|
||||
|
||||
```solidity
|
||||
function setOwner(address newOwner) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| newOwner | address | undefined |
|
||||
|
||||
### setReputation
|
||||
|
||||
```solidity
|
||||
function setReputation(contract IReputation _reputation) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | -------------------- | ----------- |
|
||||
| \_reputation | contract IReputation | undefined |
|
||||
|
||||
### setRoot
|
||||
|
||||
```solidity
|
||||
function setRoot(address addr, bytes32 merkleroot) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------- | ------- | ----------- |
|
||||
| addr | address | undefined |
|
||||
| merkleroot | bytes32 | undefined |
|
||||
|
||||
### setValidSigners
|
||||
|
||||
```solidity
|
||||
function setValidSigners(address[] _validSigners) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | --------- | ----------- |
|
||||
| \_validSigners | address[] | undefined |
|
||||
|
||||
### tokenSettings
|
||||
|
||||
```solidity
|
||||
function tokenSettings(address[] _tokens, bool[] _states) external nonpayable
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------- | --------- | ----------- |
|
||||
| \_tokens | address[] | undefined |
|
||||
| \_states | bool[] | undefined |
|
||||
|
||||
### unlockExpired
|
||||
|
||||
```solidity
|
||||
function unlockExpired(bytes32[] lockIDs) external nonpayable
|
||||
```
|
||||
|
||||
Unlocks expired locks.
|
||||
|
||||
_Triggered in the callgraph by both `lock` and `withdraw` functions.This method can also have any public actor as its `tx.origin`.For each successfull unexpired lock recovered, `userRecord[_castAddrToKey(l.relayerAddress)]` is decreased by half of its value.Function sighash: 0x8e2749d6._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | --------- | ----------- |
|
||||
| lockIDs | bytes32[] | undefined |
|
||||
|
||||
### userRecord
|
||||
|
||||
```solidity
|
||||
function userRecord(uint256) external view returns (uint256)
|
||||
```
|
||||
|
||||
_Stores an relayer's last computed credit._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
### validBacenSigners
|
||||
|
||||
```solidity
|
||||
function validBacenSigners(uint256) external view returns (bool)
|
||||
```
|
||||
|
||||
_List of valid Bacen signature addresses_
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ------- | ----------- |
|
||||
| \_0 | uint256 | undefined |
|
||||
|
||||
#### Returns
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| \_0 | bool | undefined |
|
||||
|
||||
### withdraw
|
||||
|
||||
```solidity
|
||||
function withdraw(uint256 depositID, bytes32[] expiredLocks) external nonpayable
|
||||
```
|
||||
|
||||
Seller's expired deposit fund sweeper.
|
||||
|
||||
_A seller may use this method to recover tokens from expired deposits.Function sighash: 0x36317972._
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | --------- | ----------- |
|
||||
| depositID | uint256 | undefined |
|
||||
| expiredLocks | bytes32[] | undefined |
|
||||
|
||||
### withdrawBalance
|
||||
|
||||
```solidity
|
||||
function withdrawBalance() external nonpayable
|
||||
```
|
||||
|
||||
_Contract's underlying balance withdraw method.Function sighash: 0x5fd8c710._
|
||||
|
||||
## Events
|
||||
|
||||
### AllowedERC20Updated
|
||||
|
||||
```solidity
|
||||
event AllowedERC20Updated(address indexed token, bool indexed state)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| token `indexed` | address | undefined |
|
||||
| state `indexed` | bool | undefined |
|
||||
|
||||
### DepositAdded
|
||||
|
||||
```solidity
|
||||
event DepositAdded(address indexed seller, uint256 depositID, address token, uint256 amount)
|
||||
```
|
||||
|
||||
███ Events ████████████████████████████████████████████████████████████
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| token | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### DepositClosed
|
||||
|
||||
```solidity
|
||||
event DepositClosed(address indexed seller, uint256 depositID)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
|
||||
### DepositWithdrawn
|
||||
|
||||
```solidity
|
||||
event DepositWithdrawn(address indexed seller, uint256 depositID, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| seller `indexed` | address | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### FundsWithdrawn
|
||||
|
||||
```solidity
|
||||
event FundsWithdrawn(address owner, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| owner | address | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### LockAdded
|
||||
|
||||
```solidity
|
||||
event LockAdded(address indexed buyer, bytes32 indexed lockID, uint256 depositID, uint256 amount)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockID `indexed` | bytes32 | undefined |
|
||||
| depositID | uint256 | undefined |
|
||||
| amount | uint256 | undefined |
|
||||
|
||||
### LockBlocksUpdated
|
||||
|
||||
```solidity
|
||||
event LockBlocksUpdated(uint256 blocks)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------- | ----------- |
|
||||
| blocks | uint256 | undefined |
|
||||
|
||||
### LockReleased
|
||||
|
||||
```solidity
|
||||
event LockReleased(address indexed buyer, bytes32 lockId)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockId | bytes32 | undefined |
|
||||
|
||||
### LockReturned
|
||||
|
||||
```solidity
|
||||
event LockReturned(address indexed buyer, bytes32 lockId)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------- | ------- | ----------- |
|
||||
| buyer `indexed` | address | undefined |
|
||||
| lockId | bytes32 | undefined |
|
||||
|
||||
### OwnerUpdated
|
||||
|
||||
```solidity
|
||||
event OwnerUpdated(address indexed user, address indexed newOwner)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------ | ------- | ----------- |
|
||||
| user `indexed` | address | undefined |
|
||||
| newOwner `indexed` | address | undefined |
|
||||
|
||||
### ReputationUpdated
|
||||
|
||||
```solidity
|
||||
event ReputationUpdated(address reputation)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------- | ------- | ----------- |
|
||||
| reputation | address | undefined |
|
||||
|
||||
### ValidSignersUpdated
|
||||
|
||||
```solidity
|
||||
event ValidSignersUpdated(address[] signers)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | --------- | ----------- |
|
||||
| signers | address[] | undefined |
|
||||
|
||||
## Errors
|
||||
|
||||
### AddressDenied
|
||||
|
||||
```solidity
|
||||
error AddressDenied()
|
||||
```
|
||||
|
||||
_Address doesn't exist in a MerkleTree.Address not allowed as relayer.0x3b8474be_
|
||||
|
||||
### AlreadyReleased
|
||||
|
||||
```solidity
|
||||
error AlreadyReleased()
|
||||
```
|
||||
|
||||
_Lock already released or returned.0x63b4904e_
|
||||
|
||||
### AmountNotAllowed
|
||||
|
||||
```solidity
|
||||
error AmountNotAllowed()
|
||||
```
|
||||
|
||||
_Wished amount to be locked exceeds the limit allowed.0x1c18f846_
|
||||
|
||||
### DepositAlreadyExists
|
||||
|
||||
```solidity
|
||||
error DepositAlreadyExists()
|
||||
```
|
||||
|
||||
_Deposit already exist and it is still valid.0xc44bd765_
|
||||
|
||||
### InvalidDeposit
|
||||
|
||||
```solidity
|
||||
error InvalidDeposit()
|
||||
```
|
||||
|
||||
_Deposit not valid anymore.0xb2e532de_
|
||||
|
||||
### InvalidSigner
|
||||
|
||||
```solidity
|
||||
error InvalidSigner()
|
||||
```
|
||||
|
||||
_Signer is not a valid signer.0x815e1d64_
|
||||
|
||||
### LengthMismatch
|
||||
|
||||
```solidity
|
||||
error LengthMismatch()
|
||||
```
|
||||
|
||||
_Arrays' length don't match.0xff633a38_
|
||||
|
||||
### LoopOverflow
|
||||
|
||||
```solidity
|
||||
error LoopOverflow()
|
||||
```
|
||||
|
||||
_Loop bounds have overflowed.0xdfb035c9_
|
||||
|
||||
### NoTokens
|
||||
|
||||
```solidity
|
||||
error NoTokens()
|
||||
```
|
||||
|
||||
_No tokens array provided as argument.0xdf957883_
|
||||
|
||||
### NotEnoughTokens
|
||||
|
||||
```solidity
|
||||
error NotEnoughTokens()
|
||||
```
|
||||
|
||||
_Not enough token remaining on deposit.0x22bbb43c_
|
||||
|
||||
### NotExpired
|
||||
|
||||
```solidity
|
||||
error NotExpired()
|
||||
```
|
||||
|
||||
_Lock not expired or already released.Another lock with same ID is not expired yet.0xd0404f85_
|
||||
|
||||
### OnlySeller
|
||||
|
||||
```solidity
|
||||
error OnlySeller()
|
||||
```
|
||||
|
||||
_Only seller could call this function.`msg.sender` and the seller differ.0x85d1f726_
|
||||
|
||||
### Reentrancy
|
||||
|
||||
```solidity
|
||||
error Reentrancy()
|
||||
```
|
||||
|
||||
### TokenDenied
|
||||
|
||||
```solidity
|
||||
error TokenDenied()
|
||||
```
|
||||
|
||||
_Token address not allowed to be deposited.0x1578328e_
|
||||
|
||||
### TxAlreadyUsed
|
||||
|
||||
```solidity
|
||||
error TxAlreadyUsed()
|
||||
```
|
||||
|
||||
_Transaction already used to unlock payment.0xf490a6ea_
|
||||
@@ -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,29 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## DataTypes
|
||||
|
||||
### Lock
|
||||
|
||||
```solidity
|
||||
struct Lock {
|
||||
uint256 counter;
|
||||
uint256 expirationBlock;
|
||||
bytes32 pixTarget;
|
||||
uint80 amount;
|
||||
contract ERC20 token;
|
||||
address buyerAddress;
|
||||
address seller;
|
||||
}
|
||||
```
|
||||
|
||||
### LockStatus
|
||||
|
||||
```solidity
|
||||
enum LockStatus {
|
||||
Inexistent,
|
||||
Active,
|
||||
Expired,
|
||||
Released
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## EventAndErrors
|
||||
|
||||
### DepositAdded
|
||||
|
||||
```solidity
|
||||
event DepositAdded(address seller, contract ERC20 token, uint256 amount)
|
||||
```
|
||||
|
||||
_0x63d8d7d5e63e9840ec91a12a160d27b7cfab294f6ba070b7359692acfe6b03bf_
|
||||
|
||||
### ValidSet
|
||||
|
||||
```solidity
|
||||
event ValidSet(address seller, contract ERC20 token, bool state)
|
||||
```
|
||||
|
||||
_0xca585721b6b442dc9183932f7c84dc2880efb67c4da52cc06873e78971105d49_
|
||||
|
||||
### DepositWithdrawn
|
||||
|
||||
```solidity
|
||||
event DepositWithdrawn(address seller, contract ERC20 token, uint256 amount)
|
||||
```
|
||||
|
||||
_0x2cd6435b1b961c13f55202979edd0765a809f69a539d8a477436c94c1211e43e_
|
||||
|
||||
### LockAdded
|
||||
|
||||
```solidity
|
||||
event LockAdded(address buyer, uint256 lockID, address seller, uint256 amount)
|
||||
```
|
||||
|
||||
_0x8fb3989f70bd172a37d15b41b015e48ea09d59329638377304a4198cd0c4ea65_
|
||||
|
||||
### LockReleased
|
||||
|
||||
```solidity
|
||||
event LockReleased(address buyer, uint256 lockId, uint256 amount)
|
||||
```
|
||||
|
||||
_0x364537f14276f2a0ce9905588413f96454cbb8fb2e4f5308389307c1098bede8_
|
||||
|
||||
### LockReturned
|
||||
|
||||
```solidity
|
||||
event LockReturned(address buyer, uint256 lockId)
|
||||
```
|
||||
|
||||
_0x830501e61b8b075e170b22a430e39454bdb12ed3e9620e586430b6ac00079da5_
|
||||
|
||||
### FundsWithdrawn
|
||||
|
||||
```solidity
|
||||
event FundsWithdrawn(address owner, uint256 amount)
|
||||
```
|
||||
|
||||
_0xeaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d_
|
||||
|
||||
### RootUpdated
|
||||
|
||||
```solidity
|
||||
event RootUpdated(address seller, bytes32 merkleRoot)
|
||||
```
|
||||
|
||||
_0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632_
|
||||
|
||||
### AllowedERC20Updated
|
||||
|
||||
```solidity
|
||||
event AllowedERC20Updated(address token, bool state)
|
||||
```
|
||||
|
||||
_0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a_
|
||||
|
||||
### TrustedForwarderUpdated
|
||||
|
||||
```solidity
|
||||
event TrustedForwarderUpdated(address forwarder, bool state)
|
||||
```
|
||||
|
||||
_0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92_
|
||||
|
||||
### ReputationUpdated
|
||||
|
||||
```solidity
|
||||
event ReputationUpdated(address reputation)
|
||||
```
|
||||
|
||||
_0xe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f_
|
||||
|
||||
### LockBlocksUpdated
|
||||
|
||||
```solidity
|
||||
event LockBlocksUpdated(uint256 blocks)
|
||||
```
|
||||
|
||||
_0x70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511_
|
||||
|
||||
### ValidSignersUpdated
|
||||
|
||||
```solidity
|
||||
event ValidSignersUpdated(address[] signers)
|
||||
```
|
||||
|
||||
_0x14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d7_
|
||||
|
||||
### OnlySeller
|
||||
|
||||
```solidity
|
||||
error OnlySeller()
|
||||
```
|
||||
|
||||
_Only seller could call this function.
|
||||
`msg.sender` and the seller differ.
|
||||
0x85d1f726_
|
||||
|
||||
### NotExpired
|
||||
|
||||
```solidity
|
||||
error NotExpired()
|
||||
```
|
||||
|
||||
_Lock not expired or already released.
|
||||
Another lock with same ID is not expired yet.
|
||||
0xd0404f85_
|
||||
|
||||
### LoopOverflow
|
||||
|
||||
```solidity
|
||||
error LoopOverflow()
|
||||
```
|
||||
|
||||
_Loop bounds have overflowed.
|
||||
0xdfb035c9_
|
||||
|
||||
### InvalidDeposit
|
||||
|
||||
```solidity
|
||||
error InvalidDeposit()
|
||||
```
|
||||
|
||||
_Deposit not valid anymore.
|
||||
0xb2e532de_
|
||||
|
||||
### NotEnoughTokens
|
||||
|
||||
```solidity
|
||||
error NotEnoughTokens()
|
||||
```
|
||||
|
||||
_Not enough token remaining on deposit.
|
||||
0x22bbb43c_
|
||||
|
||||
### AlreadyReleased
|
||||
|
||||
```solidity
|
||||
error AlreadyReleased()
|
||||
```
|
||||
|
||||
_Lock already released or returned.
|
||||
0x63b4904e_
|
||||
|
||||
### TxAlreadyUsed
|
||||
|
||||
```solidity
|
||||
error TxAlreadyUsed()
|
||||
```
|
||||
|
||||
_Transaction already used to unlock payment.
|
||||
0xf490a6ea_
|
||||
|
||||
### InvalidSigner
|
||||
|
||||
```solidity
|
||||
error InvalidSigner()
|
||||
```
|
||||
|
||||
_Signer is not a valid signer.
|
||||
0x815e1d64_
|
||||
|
||||
### AddressDenied
|
||||
|
||||
```solidity
|
||||
error AddressDenied()
|
||||
```
|
||||
|
||||
_Address doesn't exist in a MerkleTree.
|
||||
Address not allowed as relayer.
|
||||
0x3b8474be_
|
||||
|
||||
### LengthMismatch
|
||||
|
||||
```solidity
|
||||
error LengthMismatch()
|
||||
```
|
||||
|
||||
_Arrays' length don't match.
|
||||
0xff633a38_
|
||||
|
||||
### NoTokens
|
||||
|
||||
```solidity
|
||||
error NoTokens()
|
||||
```
|
||||
|
||||
_No tokens array provided as argument.
|
||||
0xdf957883_
|
||||
|
||||
### TokenDenied
|
||||
|
||||
```solidity
|
||||
error TokenDenied()
|
||||
```
|
||||
|
||||
_Token address not allowed to be deposited.
|
||||
0x1578328e_
|
||||
|
||||
### AmountNotAllowed
|
||||
|
||||
```solidity
|
||||
error AmountNotAllowed()
|
||||
```
|
||||
|
||||
_Wished amount to be locked exceeds the limit allowed.
|
||||
0x1c18f846_
|
||||
|
||||
### StaticCallFailed
|
||||
|
||||
```solidity
|
||||
error StaticCallFailed()
|
||||
```
|
||||
|
||||
_Reverts when success return value returns false.
|
||||
0xe10bf1cc_
|
||||
|
||||
### LockExpired
|
||||
|
||||
```solidity
|
||||
error LockExpired()
|
||||
```
|
||||
|
||||
_Reverts on an expired lock.
|
||||
0xf6fafba0_
|
||||
|
||||
### DecOverflow
|
||||
|
||||
```solidity
|
||||
error DecOverflow()
|
||||
```
|
||||
|
||||
_0xce3a3d37_
|
||||
|
||||
### MaxBalExceeded
|
||||
|
||||
```solidity
|
||||
error MaxBalExceeded()
|
||||
```
|
||||
|
||||
_0xf3fb0eb9_
|
||||
|
||||
### EmptyPixTarget
|
||||
|
||||
```solidity
|
||||
error EmptyPixTarget()
|
||||
```
|
||||
|
||||
_0x6a3bc53e_
|
||||
|
||||
### NotInitialized
|
||||
|
||||
```solidity
|
||||
error NotInitialized()
|
||||
```
|
||||
|
||||
_0x87138d5c_
|
||||
|
||||
@@ -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._
|
||||
|
||||
207
docs/p2pix.md
207
docs/p2pix.md
@@ -1,207 +0,0 @@
|
||||
# Solidity API
|
||||
|
||||
## P2PIX
|
||||
|
||||
### lockCounter
|
||||
|
||||
```solidity
|
||||
uint256 lockCounter
|
||||
```
|
||||
|
||||
### mapLocks
|
||||
|
||||
```solidity
|
||||
mapping(uint256 => struct DataTypes.Lock) mapLocks
|
||||
```
|
||||
|
||||
_List of Locks._
|
||||
|
||||
### userRecord
|
||||
|
||||
```solidity
|
||||
mapping(uint256 => uint256) userRecord
|
||||
```
|
||||
|
||||
_Stores an relayer's last computed credit._
|
||||
|
||||
### constructor
|
||||
|
||||
```solidity
|
||||
constructor(uint256 defaultBlocks, address[] validSigners, address _reputation, contract ERC20[] tokens, bool[] tokenStates) public payable
|
||||
```
|
||||
|
||||
### deposit
|
||||
|
||||
```solidity
|
||||
function deposit(string pixTarget, bytes32 allowlistRoot, contract ERC20 token, uint96 amount, bool valid) public
|
||||
```
|
||||
|
||||
Creates a deposit order based on a seller's
|
||||
offer of an amount of ERC20 tokens.
|
||||
Seller needs to send his tokens to the P2PIX smart contract.
|
||||
|
||||
_Function sighash: 0x5e918943_
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| pixTarget | string | Pix key destination provided by the offer's seller. |
|
||||
| allowlistRoot | bytes32 | Optional allow list merkleRoot update `bytes32` value. as the deposit identifier. |
|
||||
| token | contract ERC20 | |
|
||||
| amount | uint96 | |
|
||||
| valid | bool | |
|
||||
|
||||
### setValidState
|
||||
|
||||
```solidity
|
||||
function setValidState(contract ERC20 token, bool state) public
|
||||
```
|
||||
|
||||
Enables seller to invalidate future
|
||||
locks made to his/her token offering order.
|
||||
This function does not affect any ongoing active locks.
|
||||
|
||||
_Function sighash: 0x6d82d9e0_
|
||||
|
||||
### lock
|
||||
|
||||
```solidity
|
||||
function lock(address seller, contract ERC20 token, uint80 amount, bytes32[] merkleProof, uint256[] expiredLocks) public returns (uint256 lockID)
|
||||
```
|
||||
|
||||
Public method designed to lock an remaining amount of
|
||||
the deposit order of a seller.
|
||||
Transaction forwarding must leave `merkleProof` empty;
|
||||
otherwise, the trustedForwarder must be previously added
|
||||
to a seller whitelist.
|
||||
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;
|
||||
There can only exist a lock per each `_amount` partitioned
|
||||
from the total `remaining` value.
|
||||
Locks can only be performed in valid orders.
|
||||
|
||||
_Function sighash: 0xdc43221c_
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| seller | address | |
|
||||
| token | contract ERC20 | |
|
||||
| amount | uint80 | The deposit's remaining amount wished to be locked. |
|
||||
| merkleProof | bytes32[] | Provided as a pass if the `msg.sender` is in the seller's allowlist; Left empty otherwise; |
|
||||
| expiredLocks | uint256[] | An array of identifiers to be provided so to unexpire locks using this transaction gas push. |
|
||||
|
||||
#### Return Values
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| lockID | uint256 | The lock identifier. |
|
||||
|
||||
### release
|
||||
|
||||
```solidity
|
||||
function release(uint256 lockID, bytes32 pixTimestamp, bytes signature) public
|
||||
```
|
||||
|
||||
Lock release method that liquidate lock
|
||||
orders and distributes relayer fees.
|
||||
This method can be called by any public actor
|
||||
as long the signature provided is valid.
|
||||
`relayerPremium` gets splitted equaly
|
||||
if relayer addresses differ.
|
||||
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;
|
||||
|
||||
_Function sighash: 0x11fc7f9a_
|
||||
|
||||
### unlockExpired
|
||||
|
||||
```solidity
|
||||
function unlockExpired(uint256[] lockIDs) public
|
||||
```
|
||||
|
||||
Unlocks expired locks.
|
||||
Triggered in the callgraph by both `lock` and `withdraw` functions.
|
||||
This method can also have any public actor as its `tx.origin`.
|
||||
For each successfull unexpired lock recovered,
|
||||
`userRecord[_castAddrToKey(l.relayerAddress)]` is decreased by half of its value.
|
||||
|
||||
_Function sighash: 0xb0983d39_
|
||||
|
||||
### withdraw
|
||||
|
||||
```solidity
|
||||
function withdraw(contract ERC20 token, uint256 amount, uint256[] expiredLocks) public
|
||||
```
|
||||
|
||||
Seller's expired deposit fund sweeper.
|
||||
A seller may use this method to recover
|
||||
tokens from expired deposits.
|
||||
|
||||
_Function sighash: 0xfb8c5ef0_
|
||||
|
||||
### setRoot
|
||||
|
||||
```solidity
|
||||
function setRoot(address addr, bytes32 merkleroot) public
|
||||
```
|
||||
|
||||
### receive
|
||||
|
||||
```solidity
|
||||
receive() external payable
|
||||
```
|
||||
|
||||
### _addLock
|
||||
|
||||
```solidity
|
||||
function _addLock(uint256 _bal, struct DataTypes.Lock _l) internal
|
||||
```
|
||||
|
||||
### getBalance
|
||||
|
||||
```solidity
|
||||
function getBalance(address seller, contract ERC20 token) public view returns (uint256 bal)
|
||||
```
|
||||
|
||||
### getValid
|
||||
|
||||
```solidity
|
||||
function getValid(address seller, contract ERC20 token) public view returns (bool valid)
|
||||
```
|
||||
|
||||
### getPixTarget
|
||||
|
||||
```solidity
|
||||
function getPixTarget(address seller, contract ERC20 token) public view returns (bytes32 pixTarget)
|
||||
```
|
||||
|
||||
### getPixTargetString
|
||||
|
||||
```solidity
|
||||
function getPixTargetString(address seller, contract ERC20 token) public view returns (string pixTarget)
|
||||
```
|
||||
|
||||
### getBalances
|
||||
|
||||
```solidity
|
||||
function getBalances(address[] sellers, contract ERC20 token) external view returns (uint256[])
|
||||
```
|
||||
|
||||
### getLocksStatus
|
||||
|
||||
```solidity
|
||||
function getLocksStatus(uint256[] ids) external view returns (uint256[], enum DataTypes.LockStatus[])
|
||||
```
|
||||
|
||||
External getter that returns the status of a lockIDs array.
|
||||
Call will not revert if provided with an empty array as parameter.
|
||||
|
||||
_Function sighash: 0x49ef8448_
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import "@nomicfoundation/hardhat-chai-matchers";
|
||||
import "@nomicfoundation/hardhat-toolbox";
|
||||
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") });
|
||||
|
||||
@@ -14,6 +14,14 @@ if (!mnemonic) {
|
||||
throw new Error("Please set your MNEMONIC in a .env file");
|
||||
}
|
||||
|
||||
const infuraApiKey: string | undefined =
|
||||
process.env.INFURA_API_KEY;
|
||||
if (!infuraApiKey) {
|
||||
throw new Error(
|
||||
"Please set your INFURA_API_KEY in a .env file",
|
||||
);
|
||||
}
|
||||
|
||||
const alchemyApiKey: string | undefined =
|
||||
process.env.ALCHEMY_API_KEY;
|
||||
if (!alchemyApiKey) {
|
||||
@@ -26,16 +34,25 @@ const chainIds = {
|
||||
// "{INSERT_NAME}": {INSERT_ID},
|
||||
hardhat: 31337,
|
||||
mainnet: 1,
|
||||
"eth-sepolia": 11155111,
|
||||
sepolia: 11155111,
|
||||
goerli: 5,
|
||||
"polygon-mumbai": 80001,
|
||||
rootstock:30,
|
||||
"rootstock-testnet":31,
|
||||
};
|
||||
|
||||
function getChainConfig(
|
||||
chain: keyof typeof chainIds,
|
||||
): NetworkUserConfig {
|
||||
let jsonRpcUrl = "https://" + chain + ".g.alchemy.com/v2/" + alchemyApiKey;
|
||||
let jsonRpcUrl: string;
|
||||
switch (chain) {
|
||||
case "polygon-mumbai":
|
||||
jsonRpcUrl =
|
||||
"https://polygon-mumbai.g.alchemy.com/v2/" +
|
||||
alchemyApiKey;
|
||||
break;
|
||||
default:
|
||||
jsonRpcUrl =
|
||||
"https://" + chain + ".infura.io/v3/" + infuraApiKey;
|
||||
}
|
||||
return {
|
||||
// Comment out for default hardhat account settings
|
||||
accounts: {
|
||||
@@ -64,7 +81,6 @@ const config: HardhatUserConfig = {
|
||||
process.env.REPORT_GAS &&
|
||||
process.env.REPORT_GAS != "false"
|
||||
),
|
||||
offline: true,
|
||||
showTimeSpent: true,
|
||||
showMethodSig: true,
|
||||
token: "ETH",
|
||||
@@ -84,10 +100,9 @@ const config: HardhatUserConfig = {
|
||||
},
|
||||
// network: getChainConfig("{INSERT_NAME}"),
|
||||
mainnet: getChainConfig("mainnet"),
|
||||
sepolia: getChainConfig("eth-sepolia"),
|
||||
mumbai: getChainConfig("polygon-mumbai"),
|
||||
rootstock: getChainConfig("rootstock"),
|
||||
rsktestnet: getChainConfig("rootstock-testnet"),
|
||||
goerli: getChainConfig("goerli"),
|
||||
sepolia: getChainConfig("sepolia"),
|
||||
"polygon-mumbai": getChainConfig("polygon-mumbai"),
|
||||
},
|
||||
paths: {
|
||||
artifacts: "./artifacts",
|
||||
@@ -96,10 +111,10 @@ const config: HardhatUserConfig = {
|
||||
tests: "./test",
|
||||
},
|
||||
solidity: {
|
||||
version: "0.8.28",
|
||||
version: "0.8.19",
|
||||
settings: {
|
||||
viaIR: true,
|
||||
evmVersion: "cancun",
|
||||
evmVersion: "paris",
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 20_000,
|
||||
@@ -119,11 +134,8 @@ const config: HardhatUserConfig = {
|
||||
},
|
||||
typechain: {
|
||||
outDir: "src/types",
|
||||
target: "ethers-v6",
|
||||
target: "ethers-v5",
|
||||
},
|
||||
docgen: {
|
||||
pages: "files",
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
94
package.json
94
package.json
@@ -9,9 +9,10 @@
|
||||
"url": "https://github.com/doiim/p2pix-smart-contracts/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "hardhat clean",
|
||||
"compile": "hardhat compile",
|
||||
"typechain": "hardhat typechain",
|
||||
"clean": "shx rm -rf ./artifacts ./cache ./coverage ./src/types ./coverage.json && yarn typechain",
|
||||
"commit": "git-cz",
|
||||
"compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile",
|
||||
"typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
|
||||
"test": "hardhat test",
|
||||
"deploy1:localhost": "hardhat run scripts/1-deploy-mockToken.ts --network localhost",
|
||||
"deploy2:localhost": "hardhat run scripts/2-deploy-p2pix.ts --network localhost",
|
||||
@@ -23,49 +24,70 @@
|
||||
"lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check",
|
||||
"lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",
|
||||
"lint:ts": "eslint --config ./.eslintrc.yaml --ignore-path ./.eslintignore --ext .js,.ts .",
|
||||
"_postinstall": "husky install",
|
||||
"postpublish": "pinst --enable",
|
||||
"prepublishOnly": "pinst --disable",
|
||||
"prettier": "prettier --config ./.prettierrc.yaml --write \"**/*.{js,json,md,sol,ts,yaml,yml}\"",
|
||||
"prettier:check": "prettier --check --config ./.prettierrc.yaml \"**/*.{js,json,md,sol,ts,yaml,yml}\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ethersproject/abi": "^5.8.0",
|
||||
"@ethersproject/providers": "^5.8.0",
|
||||
"@nomicfoundation/hardhat-chai-matchers": "^2.1.0",
|
||||
"@nomicfoundation/hardhat-ethers": "^3.1.0",
|
||||
"@nomicfoundation/hardhat-ignition": "^0.15.13",
|
||||
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.14",
|
||||
"@nomicfoundation/hardhat-network-helpers": "^1.1.0",
|
||||
"@nomicfoundation/hardhat-toolbox": "^6.1.0",
|
||||
"@nomicfoundation/hardhat-verify": "^2.1.0",
|
||||
"@nomicfoundation/hardhat-viem": "^2.1.0",
|
||||
"@nomicfoundation/ignition-core": "^0.15.13",
|
||||
"@typechain/ethers-v6": "^0.5.1",
|
||||
"@typechain/hardhat": "^9.1.0",
|
||||
"@types/chai": "^4.3.20",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@types/node": "^24.1.0",
|
||||
"chai": "4.5.0",
|
||||
"dotenv": "^16.6.1",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"ethers": "^6.15.0",
|
||||
"hardhat": "^2.26.1",
|
||||
"hardhat-contract-sizer": "^2.10.0",
|
||||
"hardhat-gas-reporter": "^2.3.0",
|
||||
"@commitlint/cli": "^17.2.0",
|
||||
"@commitlint/config-conventional": "^17.2.0",
|
||||
"@ethersproject/abi": "^5.7.0",
|
||||
"@ethersproject/abstract-signer": "^5.7.0",
|
||||
"@ethersproject/bignumber": "^5.7.0",
|
||||
"@ethersproject/bytes": "^5.7.0",
|
||||
"@ethersproject/providers": "^5.7.2",
|
||||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.4",
|
||||
"@nomicfoundation/hardhat-network-helpers": "1.0.6",
|
||||
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
|
||||
"@nomiclabs/hardhat-ethers": "^2.2.1",
|
||||
"@nomiclabs/hardhat-etherscan": "^3.1.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
|
||||
"@typechain/ethers-v5": "^10.1.1",
|
||||
"@typechain/hardhat": "^6.1.4",
|
||||
"@types/chai": "^4.3.3",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^18.11.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"chai": "^4.3.6",
|
||||
"chalk": "4.x",
|
||||
"commitizen": "^4.2.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"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",
|
||||
"keccak256": "^1.0.6",
|
||||
"lint-staged": "^13.0.3",
|
||||
"lodash": "^4.17.21",
|
||||
"merkletreejs": "^0.5.2",
|
||||
"mocha": "^10.8.2",
|
||||
"solidity-coverage": "^0.8.16",
|
||||
"solidity-docgen": "^0.6.0-beta.36",
|
||||
"ts-node": "^10.9.2",
|
||||
"typechain": "^8.3.2",
|
||||
"typescript": "^5.8.3",
|
||||
"viem": "^2.33.1"
|
||||
"merkletreejs": "^0.2.32",
|
||||
"mocha": "^10.1.0",
|
||||
"pinst": "^3.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-solidity": "^1.0.0-rc.1",
|
||||
"shx": "^0.3.4",
|
||||
"solhint": "^3.3.7",
|
||||
"solhint-plugin-prettier": "^0.0.5",
|
||||
"solidity-coverage": "^0.8.2",
|
||||
"ts-generator": "^0.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typechain": "^8.1.1",
|
||||
"typescript": "^4.8.4"
|
||||
},
|
||||
"files": [
|
||||
"/contracts"
|
||||
],
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"packageManager": "yarn@3.2.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import "@nomicfoundation/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-etherscan";
|
||||
import { BigNumber } from "ethers";
|
||||
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: BigInt = ethers.parseEther("20000000");
|
||||
const supply: BigNumber = ethers.utils.parseEther("20000000");
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
@@ -22,11 +25,15 @@ const main = async () => {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Deploying contracts with ${deployer.address}`);
|
||||
|
||||
let erc20 = await ethers.deployContract("MockToken", [supply]);
|
||||
erc20 = await erc20.waitForDeployment();
|
||||
const ERC20Factory = await ethers.getContractFactory(
|
||||
"MockToken",
|
||||
);
|
||||
const erc20 = await ERC20Factory.deploy(supply);
|
||||
await erc20.deployed();
|
||||
|
||||
deploysJson.token = await erc20.getAddress();
|
||||
console.log("🚀 Mock Token Deployed:", await erc20.getAddress());
|
||||
deploysJson.token = erc20.address;
|
||||
console.log("🚀 Mock Token Deployed:", erc20.address);
|
||||
await erc20.deployTransaction.wait(6);
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
@@ -35,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()
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import "@nomicfoundation/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-ethers";
|
||||
import "@nomiclabs/hardhat-etherscan";
|
||||
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;
|
||||
|
||||
@@ -21,24 +23,32 @@ const main = async () => {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Deploying contracts with ${deployer.address}`);
|
||||
|
||||
let reputation = await ethers.deployContract("Reputation");
|
||||
let multicall = await ethers.deployContract("Multicall");
|
||||
let p2pix = await ethers.deployContract("P2PIX", [
|
||||
const Reputation = await ethers.getContractFactory(
|
||||
"Reputation",
|
||||
);
|
||||
const Multicall = await ethers.getContractFactory(
|
||||
"Multicall",
|
||||
);
|
||||
const reputation = await Reputation.deploy();
|
||||
await reputation.deployed();
|
||||
const mutlicall = await Multicall.deploy();
|
||||
await mutlicall.deployed();
|
||||
|
||||
const P2PIX = await ethers.getContractFactory("P2PIX");
|
||||
const p2pix = await P2PIX.deploy(
|
||||
10,
|
||||
deploysJson.signers,
|
||||
reputation.target,
|
||||
reputation.address,
|
||||
[deploysJson.token],
|
||||
[true],
|
||||
]);
|
||||
);
|
||||
await p2pix.deployed();
|
||||
|
||||
reputation = await reputation.waitForDeployment();
|
||||
multicall = await multicall.waitForDeployment();
|
||||
p2pix = await p2pix.waitForDeployment();
|
||||
|
||||
deploysJson.p2pix = await p2pix.getAddress();
|
||||
console.log("🚀 P2PIX Deployed:", await p2pix.getAddress());
|
||||
console.log("🌠 Reputation Deployed:", await reputation.getAddress());
|
||||
console.log("🛰 Multicall Deployed:", await multicall.getAddress());
|
||||
deploysJson.p2pix = p2pix.address;
|
||||
console.log("🚀 P2PIX Deployed:", p2pix.address);
|
||||
console.log("🌠 Reputation Deployed:", reputation.address);
|
||||
console.log("🛰 Multicall Deployed:", mutlicall.address);
|
||||
await p2pix.deployTransaction.wait(6);
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deploys/${network.name}.json`,
|
||||
@@ -47,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()
|
||||
|
||||
@@ -2,7 +2,7 @@ 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 { Deploys } from "../test/utils/fixtures";
|
||||
import { P2PIX__factory } from "../src/types";
|
||||
|
||||
let deploysJson: Deploys;
|
||||
|
||||
132
src/types/Reputation.ts
Normal file
132
src/types/Reputation.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
/* 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 ReputationInterface extends utils.Interface {
|
||||
functions: {
|
||||
"limiter(uint256)": FunctionFragment;
|
||||
"magicValue()": FunctionFragment;
|
||||
"maxLimit()": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic: "limiter" | "magicValue" | "maxLimit"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "limiter",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "magicValue",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "maxLimit", values?: undefined): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "limiter", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "magicValue", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "maxLimit", data: BytesLike): Result;
|
||||
|
||||
events: {};
|
||||
}
|
||||
|
||||
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]>;
|
||||
};
|
||||
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
callStatic: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
magicValue(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): 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>;
|
||||
965
src/types/core/BaseUtils.ts
Normal file
965
src/types/core/BaseUtils.ts
Normal file
@@ -0,0 +1,965 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../common";
|
||||
|
||||
export interface BaseUtilsInterface extends utils.Interface {
|
||||
functions: {
|
||||
"_castAddrToKey(address)": FunctionFragment;
|
||||
"_castKeyToAddr(uint256)": FunctionFragment;
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
"defaultLockBlocks()": FunctionFragment;
|
||||
"getStr(string)": FunctionFragment;
|
||||
"isTrustedForwarder(address)": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"setDefaultLockBlocks(uint256)": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
"setReputation(address)": FunctionFragment;
|
||||
"setTrustedFowarders(address[],bool[])": FunctionFragment;
|
||||
"setValidSigners(address[])": FunctionFragment;
|
||||
"tokenSettings(address[],bool[])": FunctionFragment;
|
||||
"usedTransactions(bytes32)": FunctionFragment;
|
||||
"validBacenSigners(uint256)": FunctionFragment;
|
||||
"withdrawBalance()": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "_castAddrToKey"
|
||||
| "_castKeyToAddr"
|
||||
| "allowedERC20s"
|
||||
| "defaultLockBlocks"
|
||||
| "getStr"
|
||||
| "isTrustedForwarder"
|
||||
| "owner"
|
||||
| "reputation"
|
||||
| "sellerAllowList"
|
||||
| "setDefaultLockBlocks"
|
||||
| "setOwner"
|
||||
| "setReputation"
|
||||
| "setTrustedFowarders"
|
||||
| "setValidSigners"
|
||||
| "tokenSettings"
|
||||
| "usedTransactions"
|
||||
| "validBacenSigners"
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castAddrToKey",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "_castKeyToAddr",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowedERC20s",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getStr",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "isTrustedForwarder",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "reputation",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "sellerAllowList",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setReputation",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setTrustedFowarders",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setValidSigners",
|
||||
values: [PromiseOrValue<string>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "tokenSettings",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "usedTransactions",
|
||||
values: [PromiseOrValue<BytesLike>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "validBacenSigners",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdrawBalance",
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castAddrToKey",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "_castKeyToAddr",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "allowedERC20s",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "getStr", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "isTrustedForwarder",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "sellerAllowList",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setReputation",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setTrustedFowarders",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setValidSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "tokenSettings",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "usedTransactions",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "validBacenSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "withdrawBalance",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"AllowedERC20Updated(address,bool)": EventFragment;
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
"TrustedForwarderUpdated(address,bool)": EventFragment;
|
||||
"ValidSet(address,address,bool)": EventFragment;
|
||||
"ValidSignersUpdated(address[])": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "AllowedERC20Updated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "FundsWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockBlocksUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReleased"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReturned"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment;
|
||||
}
|
||||
|
||||
export interface AllowedERC20UpdatedEventObject {
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type AllowedERC20UpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
AllowedERC20UpdatedEventObject
|
||||
>;
|
||||
|
||||
export type AllowedERC20UpdatedEventFilter =
|
||||
TypedEventFilter<AllowedERC20UpdatedEvent>;
|
||||
|
||||
export interface DepositAddedEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositAddedEventObject
|
||||
>;
|
||||
|
||||
export type DepositAddedEventFilter = TypedEventFilter<DepositAddedEvent>;
|
||||
|
||||
export interface DepositWithdrawnEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositWithdrawnEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type DepositWithdrawnEventFilter =
|
||||
TypedEventFilter<DepositWithdrawnEvent>;
|
||||
|
||||
export interface FundsWithdrawnEventObject {
|
||||
owner: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type FundsWithdrawnEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
FundsWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
export type LockAddedEventFilter = TypedEventFilter<LockAddedEvent>;
|
||||
|
||||
export interface LockBlocksUpdatedEventObject {
|
||||
blocks: BigNumber;
|
||||
}
|
||||
export type LockBlocksUpdatedEvent = TypedEvent<
|
||||
[BigNumber],
|
||||
LockBlocksUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type LockBlocksUpdatedEventFilter =
|
||||
TypedEventFilter<LockBlocksUpdatedEvent>;
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
export type LockReturnedEventFilter = TypedEventFilter<LockReturnedEvent>;
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface ReputationUpdatedEventObject {
|
||||
reputation: string;
|
||||
}
|
||||
export type ReputationUpdatedEvent = TypedEvent<
|
||||
[string],
|
||||
ReputationUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ReputationUpdatedEventFilter =
|
||||
TypedEventFilter<ReputationUpdatedEvent>;
|
||||
|
||||
export interface RootUpdatedEventObject {
|
||||
seller: string;
|
||||
merkleRoot: string;
|
||||
}
|
||||
export type RootUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
RootUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
||||
|
||||
export interface TrustedForwarderUpdatedEventObject {
|
||||
forwarder: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type TrustedForwarderUpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
TrustedForwarderUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type TrustedForwarderUpdatedEventFilter =
|
||||
TypedEventFilter<TrustedForwarderUpdatedEvent>;
|
||||
|
||||
export interface ValidSetEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type ValidSetEvent = TypedEvent<
|
||||
[string, string, boolean],
|
||||
ValidSetEventObject
|
||||
>;
|
||||
|
||||
export type ValidSetEventFilter = TypedEventFilter<ValidSetEvent>;
|
||||
|
||||
export interface ValidSignersUpdatedEventObject {
|
||||
signers: string[];
|
||||
}
|
||||
export type ValidSignersUpdatedEvent = TypedEvent<
|
||||
[string[]],
|
||||
ValidSignersUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ValidSignersUpdatedEventFilter =
|
||||
TypedEventFilter<ValidSignersUpdatedEvent>;
|
||||
|
||||
export interface BaseUtils extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: BaseUtilsInterface;
|
||||
|
||||
queryFilter<TEvent extends TypedEvent>(
|
||||
event: TypedEventFilter<TEvent>,
|
||||
fromBlockOrBlockhash?: string | number | undefined,
|
||||
toBlock?: string | number | undefined
|
||||
): Promise<Array<TEvent>>;
|
||||
|
||||
listeners<TEvent extends TypedEvent>(
|
||||
eventFilter?: TypedEventFilter<TEvent>
|
||||
): Array<TypedListener<TEvent>>;
|
||||
listeners(eventName?: string): Array<Listener>;
|
||||
removeAllListeners<TEvent extends TypedEvent>(
|
||||
eventFilter: TypedEventFilter<TEvent>
|
||||
): this;
|
||||
removeAllListeners(eventName?: string): this;
|
||||
off: OnEvent<this>;
|
||||
on: OnEvent<this>;
|
||||
once: OnEvent<this>;
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { _key: BigNumber }>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { _addr: string }>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { state: boolean }>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
getStr(
|
||||
str: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { strEnc: string }>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { root: string }>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { used: boolean }>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { valid: boolean }>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getStr(
|
||||
str: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getStr(
|
||||
str: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(overrides?: CallOverrides): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"AllowedERC20Updated(address,bool)"(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
AllowedERC20Updated(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
|
||||
"DepositAdded(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
DepositAdded(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
|
||||
"DepositWithdrawn(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
DepositWithdrawn(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
|
||||
"FundsWithdrawn(address,uint256)"(
|
||||
owner?: null,
|
||||
amount?: null
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
LockReleased(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
LockReturned(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
|
||||
"ReputationUpdated(address)"(
|
||||
reputation?: null
|
||||
): ReputationUpdatedEventFilter;
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
|
||||
"TrustedForwarderUpdated(address,bool)"(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
TrustedForwarderUpdated(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
ValidSet(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
|
||||
"ValidSignersUpdated(address[])"(
|
||||
signers?: null
|
||||
): ValidSignersUpdatedEventFilter;
|
||||
ValidSignersUpdated(signers?: null): ValidSignersUpdatedEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getStr(
|
||||
str: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
_castAddrToKey(
|
||||
_addr: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
_castKeyToAddr(
|
||||
_key: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
getStr(
|
||||
str: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
usedTransactions(
|
||||
message: PromiseOrValue<BytesLike>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
355
src/types/core/EventAndErrors.ts
Normal file
355
src/types/core/EventAndErrors.ts
Normal file
@@ -0,0 +1,355 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
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;
|
||||
"TrustedForwarderUpdated(address,bool)": 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: "TrustedForwarderUpdated"): 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 TrustedForwarderUpdatedEventObject {
|
||||
forwarder: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type TrustedForwarderUpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
TrustedForwarderUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type TrustedForwarderUpdatedEventFilter =
|
||||
TypedEventFilter<TrustedForwarderUpdatedEvent>;
|
||||
|
||||
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?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
|
||||
"TrustedForwarderUpdated(address,bool)"(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
TrustedForwarderUpdated(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
|
||||
"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: {};
|
||||
}
|
||||
828
src/types/core/OwnerSettings.ts
Normal file
828
src/types/core/OwnerSettings.ts
Normal file
@@ -0,0 +1,828 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
BaseContract,
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
TypedEvent,
|
||||
TypedListener,
|
||||
OnEvent,
|
||||
PromiseOrValue,
|
||||
} from "../common";
|
||||
|
||||
export interface OwnerSettingsInterface extends utils.Interface {
|
||||
functions: {
|
||||
"allowedERC20s(address)": FunctionFragment;
|
||||
"defaultLockBlocks()": FunctionFragment;
|
||||
"isTrustedForwarder(address)": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"reputation()": FunctionFragment;
|
||||
"sellerAllowList(uint256)": FunctionFragment;
|
||||
"setDefaultLockBlocks(uint256)": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
"setReputation(address)": FunctionFragment;
|
||||
"setTrustedFowarders(address[],bool[])": FunctionFragment;
|
||||
"setValidSigners(address[])": FunctionFragment;
|
||||
"tokenSettings(address[],bool[])": FunctionFragment;
|
||||
"validBacenSigners(uint256)": FunctionFragment;
|
||||
"withdrawBalance()": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "allowedERC20s"
|
||||
| "defaultLockBlocks"
|
||||
| "isTrustedForwarder"
|
||||
| "owner"
|
||||
| "reputation"
|
||||
| "sellerAllowList"
|
||||
| "setDefaultLockBlocks"
|
||||
| "setOwner"
|
||||
| "setReputation"
|
||||
| "setTrustedFowarders"
|
||||
| "setValidSigners"
|
||||
| "tokenSettings"
|
||||
| "validBacenSigners"
|
||||
| "withdrawBalance"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "allowedERC20s",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "isTrustedForwarder",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "reputation",
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "sellerAllowList",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setReputation",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setTrustedFowarders",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setValidSigners",
|
||||
values: [PromiseOrValue<string>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "tokenSettings",
|
||||
values: [PromiseOrValue<string>[], PromiseOrValue<boolean>[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "validBacenSigners",
|
||||
values: [PromiseOrValue<BigNumberish>]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "withdrawBalance",
|
||||
values?: undefined
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(
|
||||
functionFragment: "allowedERC20s",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "defaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "isTrustedForwarder",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "reputation", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "sellerAllowList",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setDefaultLockBlocks",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setReputation",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setTrustedFowarders",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "setValidSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "tokenSettings",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "validBacenSigners",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "withdrawBalance",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
|
||||
events: {
|
||||
"AllowedERC20Updated(address,bool)": EventFragment;
|
||||
"DepositAdded(address,address,uint256)": EventFragment;
|
||||
"DepositWithdrawn(address,address,uint256)": EventFragment;
|
||||
"FundsWithdrawn(address,uint256)": EventFragment;
|
||||
"LockAdded(address,uint256,uint256,uint256)": EventFragment;
|
||||
"LockBlocksUpdated(uint256)": EventFragment;
|
||||
"LockReleased(address,uint256,uint256)": EventFragment;
|
||||
"LockReturned(address,uint256)": EventFragment;
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
"ReputationUpdated(address)": EventFragment;
|
||||
"RootUpdated(address,bytes32)": EventFragment;
|
||||
"TrustedForwarderUpdated(address,bool)": EventFragment;
|
||||
"ValidSet(address,address,bool)": EventFragment;
|
||||
"ValidSignersUpdated(address[])": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "AllowedERC20Updated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "DepositWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "FundsWithdrawn"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockAdded"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockBlocksUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReleased"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "LockReturned"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ReputationUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "TrustedForwarderUpdated"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSet"): EventFragment;
|
||||
getEvent(nameOrSignatureOrTopic: "ValidSignersUpdated"): EventFragment;
|
||||
}
|
||||
|
||||
export interface AllowedERC20UpdatedEventObject {
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type AllowedERC20UpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
AllowedERC20UpdatedEventObject
|
||||
>;
|
||||
|
||||
export type AllowedERC20UpdatedEventFilter =
|
||||
TypedEventFilter<AllowedERC20UpdatedEvent>;
|
||||
|
||||
export interface DepositAddedEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositAddedEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositAddedEventObject
|
||||
>;
|
||||
|
||||
export type DepositAddedEventFilter = TypedEventFilter<DepositAddedEvent>;
|
||||
|
||||
export interface DepositWithdrawnEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type DepositWithdrawnEvent = TypedEvent<
|
||||
[string, string, BigNumber],
|
||||
DepositWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type DepositWithdrawnEventFilter =
|
||||
TypedEventFilter<DepositWithdrawnEvent>;
|
||||
|
||||
export interface FundsWithdrawnEventObject {
|
||||
owner: string;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type FundsWithdrawnEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
FundsWithdrawnEventObject
|
||||
>;
|
||||
|
||||
export type FundsWithdrawnEventFilter = TypedEventFilter<FundsWithdrawnEvent>;
|
||||
|
||||
export interface LockAddedEventObject {
|
||||
buyer: string;
|
||||
lockID: BigNumber;
|
||||
seller: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockAddedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber, BigNumber],
|
||||
LockAddedEventObject
|
||||
>;
|
||||
|
||||
export type LockAddedEventFilter = TypedEventFilter<LockAddedEvent>;
|
||||
|
||||
export interface LockBlocksUpdatedEventObject {
|
||||
blocks: BigNumber;
|
||||
}
|
||||
export type LockBlocksUpdatedEvent = TypedEvent<
|
||||
[BigNumber],
|
||||
LockBlocksUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type LockBlocksUpdatedEventFilter =
|
||||
TypedEventFilter<LockBlocksUpdatedEvent>;
|
||||
|
||||
export interface LockReleasedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
amount: BigNumber;
|
||||
}
|
||||
export type LockReleasedEvent = TypedEvent<
|
||||
[string, BigNumber, BigNumber],
|
||||
LockReleasedEventObject
|
||||
>;
|
||||
|
||||
export type LockReleasedEventFilter = TypedEventFilter<LockReleasedEvent>;
|
||||
|
||||
export interface LockReturnedEventObject {
|
||||
buyer: string;
|
||||
lockId: BigNumber;
|
||||
}
|
||||
export type LockReturnedEvent = TypedEvent<
|
||||
[string, BigNumber],
|
||||
LockReturnedEventObject
|
||||
>;
|
||||
|
||||
export type LockReturnedEventFilter = TypedEventFilter<LockReturnedEvent>;
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface ReputationUpdatedEventObject {
|
||||
reputation: string;
|
||||
}
|
||||
export type ReputationUpdatedEvent = TypedEvent<
|
||||
[string],
|
||||
ReputationUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ReputationUpdatedEventFilter =
|
||||
TypedEventFilter<ReputationUpdatedEvent>;
|
||||
|
||||
export interface RootUpdatedEventObject {
|
||||
seller: string;
|
||||
merkleRoot: string;
|
||||
}
|
||||
export type RootUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
RootUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
||||
|
||||
export interface TrustedForwarderUpdatedEventObject {
|
||||
forwarder: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type TrustedForwarderUpdatedEvent = TypedEvent<
|
||||
[string, boolean],
|
||||
TrustedForwarderUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type TrustedForwarderUpdatedEventFilter =
|
||||
TypedEventFilter<TrustedForwarderUpdatedEvent>;
|
||||
|
||||
export interface ValidSetEventObject {
|
||||
seller: string;
|
||||
token: string;
|
||||
state: boolean;
|
||||
}
|
||||
export type ValidSetEvent = TypedEvent<
|
||||
[string, string, boolean],
|
||||
ValidSetEventObject
|
||||
>;
|
||||
|
||||
export type ValidSetEventFilter = TypedEventFilter<ValidSetEvent>;
|
||||
|
||||
export interface ValidSignersUpdatedEventObject {
|
||||
signers: string[];
|
||||
}
|
||||
export type ValidSignersUpdatedEvent = TypedEvent<
|
||||
[string[]],
|
||||
ValidSignersUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type ValidSignersUpdatedEventFilter =
|
||||
TypedEventFilter<ValidSignersUpdatedEvent>;
|
||||
|
||||
export interface OwnerSettings extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
deployed(): Promise<this>;
|
||||
|
||||
interface: OwnerSettingsInterface;
|
||||
|
||||
queryFilter<TEvent extends TypedEvent>(
|
||||
event: TypedEventFilter<TEvent>,
|
||||
fromBlockOrBlockhash?: string | number | undefined,
|
||||
toBlock?: string | number | undefined
|
||||
): Promise<Array<TEvent>>;
|
||||
|
||||
listeners<TEvent extends TypedEvent>(
|
||||
eventFilter?: TypedEventFilter<TEvent>
|
||||
): Array<TypedListener<TEvent>>;
|
||||
listeners(eventName?: string): Array<Listener>;
|
||||
removeAllListeners<TEvent extends TypedEvent>(
|
||||
eventFilter: TypedEventFilter<TEvent>
|
||||
): this;
|
||||
removeAllListeners(eventName?: string): this;
|
||||
off: OnEvent<this>;
|
||||
on: OnEvent<this>;
|
||||
once: OnEvent<this>;
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { state: boolean }>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { root: string }>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean] & { valid: boolean }>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
withdrawBalance(overrides?: CallOverrides): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"AllowedERC20Updated(address,bool)"(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
AllowedERC20Updated(
|
||||
token?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): AllowedERC20UpdatedEventFilter;
|
||||
|
||||
"DepositAdded(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
DepositAdded(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositAddedEventFilter;
|
||||
|
||||
"DepositWithdrawn(address,address,uint256)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
DepositWithdrawn(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
amount?: null
|
||||
): DepositWithdrawnEventFilter;
|
||||
|
||||
"FundsWithdrawn(address,uint256)"(
|
||||
owner?: null,
|
||||
amount?: null
|
||||
): FundsWithdrawnEventFilter;
|
||||
FundsWithdrawn(owner?: null, amount?: null): FundsWithdrawnEventFilter;
|
||||
|
||||
"LockAdded(address,uint256,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
LockAdded(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockID?: PromiseOrValue<BigNumberish> | null,
|
||||
seller?: null,
|
||||
amount?: null
|
||||
): LockAddedEventFilter;
|
||||
|
||||
"LockBlocksUpdated(uint256)"(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
LockBlocksUpdated(blocks?: null): LockBlocksUpdatedEventFilter;
|
||||
|
||||
"LockReleased(address,uint256,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
LockReleased(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null,
|
||||
amount?: null
|
||||
): LockReleasedEventFilter;
|
||||
|
||||
"LockReturned(address,uint256)"(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
LockReturned(
|
||||
buyer?: PromiseOrValue<string> | null,
|
||||
lockId?: null
|
||||
): LockReturnedEventFilter;
|
||||
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
|
||||
"ReputationUpdated(address)"(
|
||||
reputation?: null
|
||||
): ReputationUpdatedEventFilter;
|
||||
ReputationUpdated(reputation?: null): ReputationUpdatedEventFilter;
|
||||
|
||||
"RootUpdated(address,bytes32)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
RootUpdated(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
merkleRoot?: PromiseOrValue<BytesLike> | null
|
||||
): RootUpdatedEventFilter;
|
||||
|
||||
"TrustedForwarderUpdated(address,bool)"(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
TrustedForwarderUpdated(
|
||||
forwarder?: PromiseOrValue<string> | null,
|
||||
state?: PromiseOrValue<boolean> | null
|
||||
): TrustedForwarderUpdatedEventFilter;
|
||||
|
||||
"ValidSet(address,address,bool)"(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
ValidSet(
|
||||
seller?: PromiseOrValue<string> | null,
|
||||
token?: null,
|
||||
state?: null
|
||||
): ValidSetEventFilter;
|
||||
|
||||
"ValidSignersUpdated(address[])"(
|
||||
signers?: null
|
||||
): ValidSignersUpdatedEventFilter;
|
||||
ValidSignersUpdated(signers?: null): ValidSignersUpdatedEventFilter;
|
||||
};
|
||||
|
||||
estimateGas: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
allowedERC20s(
|
||||
erc20: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
defaultLockBlocks(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
isTrustedForwarder(
|
||||
arg0: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
reputation(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
sellerAllowList(
|
||||
sellerKey: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setDefaultLockBlocks(
|
||||
_blocks: PromiseOrValue<BigNumberish>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setReputation(
|
||||
_reputation: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setTrustedFowarders(
|
||||
forwarders: PromiseOrValue<string>[],
|
||||
states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
setValidSigners(
|
||||
_validSigners: PromiseOrValue<string>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
tokenSettings(
|
||||
_tokens: PromiseOrValue<string>[],
|
||||
_states: PromiseOrValue<boolean>[],
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
validBacenSigners(
|
||||
signer: PromiseOrValue<BigNumberish>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
withdrawBalance(
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
6
src/types/core/index.ts
Normal file
6
src/types/core/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type { BaseUtils } from "./BaseUtils";
|
||||
export type { EventAndErrors } from "./EventAndErrors";
|
||||
export type { OwnerSettings } from "./OwnerSettings";
|
||||
116
src/types/factories/Reputation__factory.ts
Normal file
116
src/types/factories/Reputation__factory.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
/* 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 { Reputation, ReputationInterface } from "../Reputation";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
stateMutability: "payable",
|
||||
type: "constructor",
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x6080806040526102c990816100128239f3fe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212202029db6a087d223f768aabc1fe8120c7f9d7e525e947a354114a42f80a3955db64736f6c63430008130033";
|
||||
|
||||
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?: PayableOverrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<Reputation> {
|
||||
return super.deploy(overrides || {}) as Promise<Reputation>;
|
||||
}
|
||||
override getDeployTransaction(
|
||||
overrides?: PayableOverrides & { 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;
|
||||
}
|
||||
}
|
||||
698
src/types/factories/core/BaseUtils__factory.ts
Normal file
698
src/types/factories/core/BaseUtils__factory.ts
Normal file
@@ -0,0 +1,698 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type { BaseUtils, BaseUtilsInterface } from "../../core/BaseUtils";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "AddressDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AlreadyReleased",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AmountNotAllowed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "EmptyPixTarget",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidDeposit",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSigner",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LengthMismatch",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LockExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LoopOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "MaxBalExceeded",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NoTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotEnoughTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotInitialized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "OnlySeller",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "Reentrancy",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "StaticCallFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TokenDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TxAlreadyUsed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "AllowedERC20Updated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "FundsWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "seller",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockBlocksUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReleased",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "forwarder",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "TrustedForwarderUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "ValidSet",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address[]",
|
||||
name: "signers",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "_addr",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "_castAddrToKey",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_key",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_key",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "_castKeyToAddr",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "_addr",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20",
|
||||
name: "erc20",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "allowedERC20s",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "defaultLockBlocks",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "string",
|
||||
name: "str",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
name: "getStr",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "strEnc",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "isTrustedForwarder",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "reputation",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "sellerKey",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "sellerAllowList",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "setDefaultLockBlocks",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "_reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setReputation",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "forwarders",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "setTrustedFowarders",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "_validSigners",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "setValidSigners",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20[]",
|
||||
name: "_tokens",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "_states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "tokenSettings",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "message",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "usedTransactions",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "used",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "signer",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "validBacenSigners",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "valid",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "withdrawBalance",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class BaseUtils__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): BaseUtilsInterface {
|
||||
return new utils.Interface(_abi) as BaseUtilsInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): BaseUtils {
|
||||
return new Contract(address, _abi, signerOrProvider) as BaseUtils;
|
||||
}
|
||||
}
|
||||
386
src/types/factories/core/EventAndErrors__factory.ts
Normal file
386
src/types/factories/core/EventAndErrors__factory.ts
Normal file
@@ -0,0 +1,386 @@
|
||||
/* 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 "../../core/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: "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: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "FundsWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "seller",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockBlocksUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReleased",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "forwarder",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "TrustedForwarderUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "ValidSet",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address[]",
|
||||
name: "signers",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
];
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
620
src/types/factories/core/OwnerSettings__factory.ts
Normal file
620
src/types/factories/core/OwnerSettings__factory.ts
Normal file
@@ -0,0 +1,620 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
import type { Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
OwnerSettings,
|
||||
OwnerSettingsInterface,
|
||||
} from "../../core/OwnerSettings";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "AddressDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AlreadyReleased",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "AmountNotAllowed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "DecOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "EmptyPixTarget",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidDeposit",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "InvalidSigner",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LengthMismatch",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LockExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "LoopOverflow",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "MaxBalExceeded",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NoTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotEnoughTokens",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotExpired",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "NotInitialized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "OnlySeller",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "StaticCallFailed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TokenDenied",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "TxAlreadyUsed",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "AllowedERC20Updated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "DepositWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "owner",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "FundsWithdrawn",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
name: "lockID",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "seller",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockAdded",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockBlocksUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "amount",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReleased",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "buyer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "uint256",
|
||||
name: "lockId",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "LockReturned",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address",
|
||||
name: "reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "ReputationUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bytes32",
|
||||
name: "merkleRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
name: "RootUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "forwarder",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "TrustedForwarderUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "seller",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "contract ERC20",
|
||||
name: "token",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
name: "ValidSet",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: false,
|
||||
internalType: "address[]",
|
||||
name: "signers",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "ValidSignersUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20",
|
||||
name: "erc20",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "allowedERC20s",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "state",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "defaultLockBlocks",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "isTrustedForwarder",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "reputation",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "sellerKey",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "sellerAllowList",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_blocks",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "setDefaultLockBlocks",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract IReputation",
|
||||
name: "_reputation",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setReputation",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "forwarders",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "setTrustedFowarders",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address[]",
|
||||
name: "_validSigners",
|
||||
type: "address[]",
|
||||
},
|
||||
],
|
||||
name: "setValidSigners",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "contract ERC20[]",
|
||||
name: "_tokens",
|
||||
type: "address[]",
|
||||
},
|
||||
{
|
||||
internalType: "bool[]",
|
||||
name: "_states",
|
||||
type: "bool[]",
|
||||
},
|
||||
],
|
||||
name: "tokenSettings",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "signer",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "validBacenSigners",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "valid",
|
||||
type: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "withdrawBalance",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
export class OwnerSettings__factory {
|
||||
static readonly abi = _abi;
|
||||
static createInterface(): OwnerSettingsInterface {
|
||||
return new utils.Interface(_abi) as OwnerSettingsInterface;
|
||||
}
|
||||
static connect(
|
||||
address: string,
|
||||
signerOrProvider: Signer | Provider
|
||||
): OwnerSettings {
|
||||
return new Contract(address, _abi, signerOrProvider) as OwnerSettings;
|
||||
}
|
||||
}
|
||||
6
src/types/factories/core/index.ts
Normal file
6
src/types/factories/core/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { BaseUtils__factory } from "./BaseUtils__factory";
|
||||
export { EventAndErrors__factory } from "./EventAndErrors__factory";
|
||||
export { OwnerSettings__factory } from "./OwnerSettings__factory";
|
||||
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 core from "./core";
|
||||
export * as lib from "./lib";
|
||||
export * as p2PixSol from "./p2pix.sol";
|
||||
export { Reputation__factory } from "./Reputation__factory";
|
||||
70
src/types/factories/lib/auth/Owned__factory.ts
Normal file
70
src/types/factories/lib/auth/Owned__factory.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/* 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 = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
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";
|
||||
9
src/types/factories/lib/index.ts
Normal file
9
src/types/factories/lib/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* Autogenerated file. Do not edit manually. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * as auth from "./auth";
|
||||
export * as interfaces from "./interfaces";
|
||||
export * as metatx from "./metatx";
|
||||
export * as mock from "./mock";
|
||||
export * as tokens from "./tokens";
|
||||
export * as utils from "./utils";
|
||||
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;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user