CoinJoin

Git Source

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

NameTypeDescription
_safeEngineaddressAddress of the SAFEEngine contract
_systemCoinaddressAddress 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

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

function exit(address _account, uint256 _wad) external whenEnabled;

Parameters

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