CoinJoin
Inherits: Authorizable, Disableable, ICoinJoin
This contract allows to connect the SAFEEngine with the system coin
This contract needs to be authorized in Coin and SAFEEngine
State Variables
safeEngine
Address of the SAFEEngine contract
ISAFEEngine public safeEngine;
systemCoin
Address of the SystemCoin contract
ISystemCoin public systemCoin;
decimals
Number of decimals the coin has
uint256 public decimals;
Functions
constructor
constructor(address _safeEngine, address _systemCoin) Authorizable(msg.sender);
Parameters
Name | Type | Description |
---|---|---|
_safeEngine | address | Address of the SAFEEngine contract |
_systemCoin | address | Address of the SystemCoin contract |
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
Name | Type | Description |
---|---|---|
_account | address | Account that will receive the joined coins |
_wad | uint256 | Amount of external coins to join [wad] |
exit
Exit system coins from the system
New coins cannot be minted after the system is disabled
function exit(address _account, uint256 _wad) external whenEnabled;
Parameters
Name | Type | Description |
---|---|---|
_account | address | Account that will receive the exited coins |
_wad | uint256 | Amount of internal coins to join (18 decimal number) |