ICoinJoin

Git Source

Inherits: IAuthorizable, IDisableable

Functions

safeEngine

Address of the SAFEEngine contract

function safeEngine() external view returns (ISAFEEngine _safeEngine);

systemCoin

Address of the SystemCoin contract

function systemCoin() external view returns (ISystemCoin _systemCoin);

decimals

Number of decimals the coin has

function decimals() external view returns (uint256 _decimals);

join

Join system coins in the system

Exited coins have 18 decimals but inside the system they have 45 [rad] decimals. When we join, the amount [wad] is multiplied by 10**27 [ray]

function join(address _account, uint256 _wad) external;

Parameters

NameTypeDescription
_accountaddressAccount that will receive the joined coins
_waduint256Amount of external coins to join [wad]

exit

Exit system coins from the system

New coins cannot be minted after the system is disabled

Inside the system, coins have 45 decimals [rad] but outside of it they have 18 decimals [wad]. When we exit, we specify a wad amount of coins and then the contract automatically multiplies wad by 10**27 to move the correct 45 decimal coin amount to this adapter

function exit(address _account, uint256 _wad) external;

Parameters

NameTypeDescription
_accountaddressAccount that will receive the exited coins
_waduint256Amount of internal coins to join (18 decimal number)

Events

Join

Emitted when an account joins coins into the system

event Join(address _sender, address _account, uint256 _wad);

Parameters

NameTypeDescription
_senderaddressAddress of the account that called the function (sent the ERC20 coins)
_accountaddressAddress of the account that received the coins
_waduint256Amount of coins joined [wad]

Exit

Emitted when an account exits coins from the system

event Exit(address _sender, address _account, uint256 _wad);

Parameters

NameTypeDescription
_senderaddressAddress of the account that called the function (sent the internal coins)
_accountaddressAddress of the account that received the ERC20 coins
_waduint256Amount of coins exited [wad]