-
Notifications
You must be signed in to change notification settings - Fork 2
Contracts
The GigaToken contract is a custom token contract for the "GigaToken". It includes functionalities such as burnable tokens, token snapshots, access control, pausability, and permit features. The token also adds the ability to increase and decrease unlocked tokens for a specific address. The increase and decrease of unlocked tokens are controlled by an account with the minter role. Transfers are only allowed when the contract is not paused and if the sender has enough unlocked tokens.
Here are the main functions of the GigaToken contract:
-
increaseUnlockedTokens(address _recipient, uint _amount): This function increases the amount of unlocked tokens for a given address. It can only be called by an account with the minter role.- Params:
-
_recipient: The address to increase the unlocked tokens for. -
_amount: The amount of tokens to unlock.
-
- Returns: This function does not return a value
- Params:
-
decreaseUnlockedTokens(address _recipient, uint _amount): This function decreases the amount of unlocked tokens for a given address. It can only be called by an account with the minter role.- Params:
-
_recipient: The address to decrease the unlocked tokens for. -
_amount: The amount of tokens to lock.
-
- Returns: This function does not return a value.
- Params:
-
mint(address _to, uint256 _amount): This function createsamountnew tokens and assigns them toaccount, increasing the total supply. It can only be called by an account with the minter role.- Params:
-
_to: Address to mint the tokens to. -
_amount: Amount of tokens to mint.
-
- Returns: This function does not return a value.
- Params:
-
pause(): This function pauses all token transfers. It can only be called by an account with the pauser role.- Params: This function does not require any parameters.
- Returns: This function does not return a value.
-
unpause(): This function unpauses all token transfers. It can only be called by an account with the pauser role.- Params: This function does not require any parameters.
- Returns: This function does not return a value.
-
snapshot(): This function creates a new snapshot ID. It can only be called by an account with the snapshot role.- Params: This function does not require any parameters.
- Returns: This function does not return a value.
The MultiSig contract implements a multi-signature wallet. Transactions can be executed only when approved by a threshold number of signers.
Here are the main functions of the MultiSig contract:
-
addAdditionalOwners(address _signer): This function adds additional owners to the multisig.- Params:
-
_signer: The address to be added to the signers list.
-
- Returns: This function does not return a value.
- Params:
-
resign(): This function allows a signer to resign, removing them from the multisig.- Params: This function does not require any parameters.
- Returns: This function does not return a value.
-
executeTransaction(bytes[] memory signatures, address _to, uint256 _value, bytes memory _data, bytes32 _nonce): This function executes a multisig transaction given an array of signatures, and TxnRequest params.- Params:
-
signatures: The array of signatures from multisig holders. -
_to: The address a transaction should be sent to. -
_value: The transaction value. -
_data: The data to be sent with the transaction (e.g: to call a contract function). -
_nonce: The transaction nonce.
-
- Returns: This function does not return a value.
- Params:
-
changeThreshold(uint _threshold): This function changes the threshold for the multisig.- Params:
-
_threshold: The new threshold.
-
- Returns: This function does not return a value.
- Params:
The Verifier contract is used for recovering the signer of a given message.
Here are the main functions of the Verifier contract:
-
recoverSigner(bytes32 _nonce, bytes memory userSignature): This function recovers signer's address for a given signature.- Params:
-
_nonce: The unique transaction nonce. -
userSignature: The signature provided by the user.
-
- Returns: This function does not return a value.
- Params: