Skip to content

Latest commit

 

History

History
418 lines (351 loc) · 12.4 KB

TokenSender.md

File metadata and controls

418 lines (351 loc) · 12.4 KB

SOV Token sender contract.

  • (TokenSender.sol)

View Source: contracts/governance/Vesting/TokenSender.sol

↗ Extends: Ownable

TokenSender contract

This contract includes functions to transfer SOV tokens to a recipient or to several recipients in a list. There is an ACL control check by modifier.

Contract Members

Constants & Variables

address public SOV;
mapping(address => bool) public admins;

Events

event SOVTransferred(address indexed receiver, uint256  amount);
event AdminAdded(address  admin);
event AdminRemoved(address  admin);

Modifiers

onlyAuthorized

Throws if called by any account other than the owner or admin.

modifier onlyAuthorized() internal

Functions


constructor

function (address _SOV) public nonpayable

Arguments

Name Type Description
_SOV address
Source Code
constructor(address _SOV) public {
        require(_SOV != address(0), "SOV address invalid");

        SOV = _SOV;
    }

addAdmin

Add account to ACL.

function addAdmin(address _admin) public nonpayable onlyOwner 

Arguments

Name Type Description
_admin address The addresses of the account to grant permissions.
Source Code
function addAdmin(address _admin) public onlyOwner {
        admins[_admin] = true;
        emit AdminAdded(_admin);
    }

removeAdmin

Remove account from ACL.

function removeAdmin(address _admin) public nonpayable onlyOwner 

Arguments

Name Type Description
_admin address The addresses of the account to revoke permissions.
Source Code
function removeAdmin(address _admin) public onlyOwner {
        admins[_admin] = false;
        emit AdminRemoved(_admin);
    }

transferSOVusingList

Transfer given amounts of SOV to the given addresses.

function transferSOVusingList(address[] _receivers, uint256[] _amounts) public nonpayable onlyAuthorized 

Arguments

Name Type Description
_receivers address[] The addresses of the SOV receivers.
_amounts uint256[] The amounts to be transferred.
Source Code
function transferSOVusingList(address[] memory _receivers, uint256[] memory _amounts)
        public
        onlyAuthorized
    {
        require(_receivers.length == _amounts.length, "arrays mismatch");

        for (uint256 i = 0; i < _receivers.length; i++) {
            _transferSOV(_receivers[i], _amounts[i]);
        }
    }

transferSOV

Transfer SOV tokens to given address.

function transferSOV(address _receiver, uint256 _amount) public nonpayable onlyAuthorized 

Arguments

Name Type Description
_receiver address The address of the SOV receiver.
_amount uint256 The amount to be transferred.
Source Code
function transferSOV(address _receiver, uint256 _amount) public onlyAuthorized {
        _transferSOV(_receiver, _amount);
    }

_transferSOV

function _transferSOV(address _receiver, uint256 _amount) internal nonpayable

Arguments

Name Type Description
_receiver address
_amount uint256
Source Code
function _transferSOV(address _receiver, uint256 _amount) internal {
        require(_receiver != address(0), "receiver address invalid");
        require(_amount != 0, "amount invalid");

        require(IERC20(SOV).transfer(_receiver, _amount), "transfer failed");
        emit SOVTransferred(_receiver, _amount);
    }

Contracts