update documentation
This commit is contained in:
89
docs/core/BaseUtils.md
Normal file
89
docs/core/BaseUtils.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# 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)
|
||||
```
|
||||
|
||||
96
docs/core/Constants.md
Normal file
96
docs/core/Constants.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# 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
|
||||
```
|
||||
|
||||
29
docs/core/DataTypes.md
Normal file
29
docs/core/DataTypes.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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
|
||||
}
|
||||
```
|
||||
|
||||
278
docs/core/EventAndErrors.md
Normal file
278
docs/core/EventAndErrors.md
Normal file
@@ -0,0 +1,278 @@
|
||||
# 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_
|
||||
|
||||
98
docs/core/OwnerSettings.md
Normal file
98
docs/core/OwnerSettings.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# 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)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user