- (GenericTokenSender.sol)
View Source: contracts/governance/Vesting/GenericTokenSender.sol
↗ Extends: AdminRole
This contract includes functions to transfer tokens to a recipient or to several recipients in a list. There is an ACL control check by modifier.
Events
event TokensTransferred(address indexed token, address indexed receiver, uint256 amount);
- transferTokensUsingList(address _token, address[] _receivers, uint256[] _amounts)
- transferTokens(address _token, address _receiver, uint256 _amount)
- _transferTokens(address _token, address _receiver, uint256 _amount)
Transfer given amounts of tokens to the given addresses.
function transferTokensUsingList(address _token, address[] _receivers, uint256[] _amounts) external nonpayable onlyAuthorized
Arguments
Name | Type | Description |
---|---|---|
_token | address | The address of the token. |
_receivers | address[] | The addresses of the receivers. |
_amounts | uint256[] | The amounts to be transferred. |
Source Code
function transferTokensUsingList(
address _token,
address[] calldata _receivers,
uint256[] calldata _amounts
) external onlyAuthorized {
require(_receivers.length == _amounts.length, "arrays mismatch");
for (uint256 i = 0; i < _receivers.length; i++) {
_transferTokens(_token, _receivers[i], _amounts[i]);
}
}
Transfer tokens to given address.
function transferTokens(address _token, address _receiver, uint256 _amount) external nonpayable onlyAuthorized
Arguments
Name | Type | Description |
---|---|---|
_token | address | The address of the token. |
_receiver | address | The address of the token receiver. |
_amount | uint256 | The amount to be transferred. |
Source Code
function transferTokens(
address _token,
address _receiver,
uint256 _amount
) external onlyAuthorized {
_transferTokens(_token, _receiver, _amount);
}
function _transferTokens(address _token, address _receiver, uint256 _amount) internal nonpayable
Arguments
Name | Type | Description |
---|---|---|
_token | address | |
_receiver | address | |
_amount | uint256 |
Source Code
function _transferTokens(
address _token,
address _receiver,
uint256 _amount
) internal {
require(_token != address(0), "token address invalid");
require(_receiver != address(0), "receiver address invalid");
require(_amount != 0, "amount invalid");
require(IERC20(_token).transfer(_receiver, _amount), "transfer failed");
emit TokensTransferred(_token, _receiver, _amount);
}
- Address
- Administered
- AdminRole
- AdvancedToken
- AdvancedTokenStorage
- Affiliates
- AffiliatesEvents
- ApprovalReceiver
- BProPriceFeed
- CheckpointsShared
- Constants
- Context
- DevelopmentFund
- DummyContract
- EnumerableAddressSet
- EnumerableBytes32Set
- EnumerableBytes4Set
- ERC20
- ERC20Detailed
- ErrorDecoder
- Escrow
- EscrowReward
- FeedsLike
- FeesEvents
- FeeSharingCollector
- FeeSharingCollectorProxy
- FeeSharingCollectorStorage
- FeesHelper
- FourYearVesting
- FourYearVestingFactory
- FourYearVestingLogic
- FourYearVestingStorage
- GenericTokenSender
- GovernorAlpha
- GovernorVault
- IApproveAndCall
- IChai
- IContractRegistry
- IConverterAMM
- IERC1820Registry
- IERC20_
- IERC20
- IERC777
- IERC777Recipient
- IERC777Sender
- IFeeSharingCollector
- IFourYearVesting
- IFourYearVestingFactory
- IFunctionsList
- ILiquidityMining
- ILiquidityPoolV1Converter
- ILoanPool
- ILoanToken
- ILoanTokenLogicBeacon
- ILoanTokenLogicModules
- ILoanTokenLogicProxy
- ILoanTokenModules
- ILoanTokenWRBTC
- ILockedSOV
- IMoCState
- IModulesProxyRegistry
- Initializable
- InterestUser
- IPot
- IPriceFeeds
- IPriceFeedsExt
- IProtocol
- IRSKOracle
- ISovryn
- ISovrynSwapNetwork
- IStaking
- ISwapsImpl
- ITeamVesting
- ITimelock
- IV1PoolOracle
- IVesting
- IVestingFactory
- IVestingRegistry
- IWrbtc
- IWrbtcERC20
- LenderInterestStruct
- LiquidationHelper
- LiquidityMining
- LiquidityMiningConfigToken
- LiquidityMiningProxy
- LiquidityMiningStorage
- LoanClosingsEvents
- LoanClosingsLiquidation
- LoanClosingsRollover
- LoanClosingsShared
- LoanClosingsWith
- LoanClosingsWithoutInvariantCheck
- LoanInterestStruct
- LoanMaintenance
- LoanMaintenanceEvents
- LoanOpenings
- LoanOpeningsEvents
- LoanParamsStruct
- LoanSettings
- LoanSettingsEvents
- LoanStruct
- LoanToken
- LoanTokenBase
- LoanTokenLogicBeacon
- LoanTokenLogicLM
- LoanTokenLogicProxy
- LoanTokenLogicStandard
- LoanTokenLogicStorage
- LoanTokenLogicWrbtc
- LoanTokenSettingsLowerAdmin
- LockedSOV
- MarginTradeStructHelpers
- Medianizer
- ModuleCommonFunctionalities
- ModulesCommonEvents
- ModulesProxy
- ModulesProxyRegistry
- MultiSigKeyHolders
- MultiSigWallet
- Mutex
- Objects
- OrderStruct
- OrigingVestingCreator
- OriginInvestorsClaim
- Ownable
- Pausable
- PausableOz
- PreviousLoanToken
- PreviousLoanTokenSettingsLowerAdmin
- PriceFeedRSKOracle
- PriceFeeds
- PriceFeedsLocal
- PriceFeedsMoC
- PriceFeedV1PoolOracle
- ProtocolAffiliatesInterface
- ProtocolLike
- ProtocolSettings
- ProtocolSettingsEvents
- ProtocolSettingsLike
- ProtocolSwapExternalInterface
- ProtocolTokenUser
- Proxy
- ProxyOwnable
- ReentrancyGuard
- RewardHelper
- RSKAddrValidator
- SafeERC20
- SafeMath
- SafeMath96
- setGet
- SharedReentrancyGuard
- SignedSafeMath
- SOV
- sovrynProtocol
- StakingAdminModule
- StakingGovernanceModule
- StakingInterface
- StakingProxy
- StakingRewards
- StakingRewardsProxy
- StakingRewardsStorage
- StakingShared
- StakingStakeModule
- StakingStorageModule
- StakingStorageShared
- StakingVestingModule
- StakingWithdrawModule
- State
- SwapsEvents
- SwapsExternal
- SwapsImplLocal
- SwapsImplSovrynSwap
- SwapsUser
- TeamVesting
- Timelock
- TimelockHarness
- TimelockInterface
- TokenSender
- UpgradableProxy
- USDTPriceFeed
- Utils
- VaultController
- Vesting
- VestingCreator
- VestingFactory
- VestingLogic
- VestingRegistry
- VestingRegistry2
- VestingRegistry3
- VestingRegistryLogic
- VestingRegistryProxy
- VestingRegistryStorage
- VestingStorage
- WeightedStakingModule
- WRBTC