Skip to content

Latest commit

 

History

History
128 lines (87 loc) · 3.02 KB

CappedTransfer.md

File metadata and controls

128 lines (87 loc) · 3.02 KB

Capped Transfer (CappedTransfer.sol)

View Source: contracts/CappedTransfer.sol

↗ Extends: CustomPausable ↘ Derived Contracts: TransferBase

CappedTransfer

The capped transfer contract outlines the rules on the maximum amount of ERC20 or Ether transfer for each transaction.

Contract Members

Constants & Variables

uint256 private _maximumTransfer;
uint256 private _maximumTransferWei;

Events

event CapChanged(uint256  maximumTransfer, uint256  maximumTransferWei, uint256  oldMaximumTransfer, uint256  oldMaximumTransferWei);

Functions

checkIfValidTransfer

Ensures that the requested ERC20 transfer amount is within the maximum allowed limit.

function checkIfValidTransfer(uint256 amount) public view
returns(bool)

Returns

Returns true if the transfer request is valid and acceptable.

Arguments

Name Type Description
amount uint256 The amount being requested to be transferred out of this contract.

checkIfValidWeiTransfer

Ensures that the requested wei transfer amount is within the maximum allowed limit.

function checkIfValidWeiTransfer(uint256 amount) public view
returns(bool)

Returns

Returns true if the transfer request is valid and acceptable.

Arguments

Name Type Description
amount uint256 The Ether wei unit amount being requested to be transferred out of this contract.

setCap

Sets the maximum cap for a single ERC20 and Ether transfer.

function setCap(uint256 cap, uint256 weiCap) external nonpayable onlyOwner whenNotPaused 
returns(bool)

Returns

Returns true if the operation was successful.

Arguments

Name Type Description
cap uint256
weiCap uint256

getCap

Gets the transfer cap defined in this contract.

function getCap() external view
returns(uint256, uint256)

Returns

Returns maximum allowed value for a single transfer operation of ERC20 token and Ethereum.

Arguments

Name Type Description

Contracts