DYSON

DYSON is an ERC20 contract for the $DYSON token.

rescueERC20

Rescues ERC-20 tokens stuck in the contract and transfers them to a specified address.

function rescueERC20(
    address tokenAddress, 
    address to, 
    uint256 amount) onlyOwner external

Parameters:

NameTypeDescription

tokenAddress

address

Address of the ERC-20 token to be rescued.

to

address

Address that will receive the rescued tokens.

amount

uint

Amount of tokens to be rescued.

addMinter

Enables an address to mint new tokens. Currently, only the Farm contract is authorized as a minter who is responsible for minting $DYSN rewards.

function addMinter(
    address _minter) external onlyOwner

Parameters:

NameTypeDescription

_minter

address

Address to be added as a minter.

removeMinter

Removes an address from the list of minters, preventing it from minting new tokens.

function removeMinter(
    address _minter) external onlyOwner

Parameters:

NameTypeDescription

_minter

address

Address to be removed from minters.

approve

Approves the spender to spend a specified amount of tokens on behalf of the owner.

function approve(
    address spender, 
    uint amount) external returns (bool)

Parameters:

NameTypeDescription

spender

address

Address allowed to spend the tokens.

amount

uint

Amount of tokens to approve.

Return Values:

NameTypeDescription

None

bool

Boolean indicating success.

transfer

Transfers a specified amount of tokens to a target address.

function transfer(    
    address to, 
    uint amount) external returns (bool)

Parameters:

NameTypeDescription

to

address

Address to which tokens will be transferred.

amount

uint

Amount of tokens to transfer.

Return Values:

NameTypeDescription

None

bool

Boolean indicating success.

transferFrom

Transfers a specified amount of tokens from one address to another, subject to approval.

function transferFrom(
    address from, 
    address to, 
    uint amount) external returns (bool)

Parameters:

NameTypeDescription

from

address

Address from which tokens will be transferred.

to

address

Address to which tokens will be transferred.

amount

uint

Amount of tokens to transfer.

Return Values:

NameTypeDescription

None

bool

Boolean indicating success.

mint

Mints a specified amount of new tokens and assigns them to a specified address.

function mint(
    address to, 
    uint amount) external returns (bool)

Parameters:

NameTypeDescription

to

address

Address to receive the minted tokens.

amount

uint

Amount of tokens to mint.

Return Values:

NameTypeDescription

None

bool

Boolean indicating success.

burn

Burns a specified amount of tokens from a specified address.

function burn(
    address from, 
    uint amount) external returns (bool)

Parameters:

NameTypeDescription

from

address

Address from which tokens will be burned.

amount

uint

Amount of tokens to burn.

Return Values:

NameTypeDescription

None

bool

Boolean indicating success.

permit

Implements the EIP-2612 permit function, allowing an owner to approve token spending with a signature.

function permit(
    address _owner,
    address _spender,
    uint256 _amount,
    uint256 _deadline,
    uint8 _v,
    bytes32 _r,
    bytes32 _s) external

Parameters:

NameTypeDescription

_owner

address

Token owner's address.

_spender

address

Address allowed to spend the tokens.

_amount

uint

Amount of tokens to approve.

_deadline

uint

Deadline for the permit.

_v

uint8

Must produce a valid secp256k1 signature from the holder along with _r and _s.

_r

bytes32

Must produce a valid secp256k1 signature from the holder along with _v and _s.

_s

bytes32

Must produce a valid secp256k1 signature from the holder along with _v and _r.

Last updated