πŸ“„State Functions & Variables

Multi-Sig (DeFault-Admin)

This is the master wallet for the smart contract which has the defaultAdmin role and is responsible for granting and revoking other roles in the smart contract, as well as pausing and unpausing the smart contract. This is a multi-sig wallet.

GrantRole: This function is used to set roles. Only the DaFault_Admin_Role can call this function.

RevokeRole: This function is used to revoke roles. Only the DaFault_Admin_Role can call this function.

Verified Request

This struct represents a verified request, which is used for signature generation and verification.

  • from: The address from which the request originates. This would always be considered as the verifiedSigner in the wallet

  • to: The address to which the request is being sent.

  • nonce: A unique nonce value for each request.

  • validUntil: A timestamp indicating the validity of the request.

Nonce: This returns the nonce of a user in the smart contract which is used in the signature generation process. This value increments for every user after executing authorized transactions.

Verified_Signer

The role grants permission to the user to sign smart contract signatures generated for the user's wallet transaction request. For the following methods: sellEscrowLockNative, sellNative, buyEscrowLockNative. This method returns a unique bytes32 representing the key of verified signers in the protocol.

Executor(s)

This is a delegated wallet address that executes transactions on behalf of the user's signed request on the smart contract.

The executor role grants permission to trigger smart-contract transactions on the following methods: sellEscrowLock, sellEscrowCancel, sellEscrowApprove, sell, buyEscrowLock, buyEscrowApprove, and buyEscrowCancel.

The executor can be multiple wallets assigned by the multi-sig (DeFaultAdmin). Currently, we use one executor wallet which serves as the trade moderator during disputes. In the future, we intend to make this function to more moderators who can serve as the executors.

Whitelisted

This returns yes or no if token is whitelisted or not. Only whitelisted tokens can be bought/sold

Whitelist

This function is used to whitelist or remove addresses from the whitelist. Only the DeFault_Admin_Role can call this function

  • addrs: To get the list of token addresses to be whitelisted or removed from the whitelist

  • _whitelist: indicating whether to whitelist (true/false)

emits whitelist event

Pauser

Pauser (Admin): This is a delegated wallet address that can initiate the pause function on the smart-contract and it can only be set by the DeFault_Admin_Role

Payment

Payment Wallet (Fee Wallet): This is a delegated wallet for collecting fees and can only be set by the DeFault_Admin_Role

Claimable Fees: This returns the available fees claimable in the contract. Get's claimed during trade approvals executed by the Payment Wallet.

ClaimFee: This function is used to claim the accumulated fees for a specific token. Only the ADMIN can call this function. It takes the address of the token for which the fees will be claimed. See claimableFees.

emits ClaimFee event.

Gas Estimation: (const gasToPay = gasUnit * gasPrice) This is the gas fee needed to execute a transaction on the network.

Last updated