Skip to main content

MakerRouter

k-xo

This contracts allows for swaps between FEI-DAI and FEI-USDC by using the FEI FEI-DAI PSM and the Maker DAI-USDC PSM

Methods

CONTRACT_ADMIN_ROLE

function CONTRACT_ADMIN_ROLE() external view returns (bytes32)

a role used with a subset of governor permissions for this contract only

Returns

NameTypeDescription
_0bytes32undefined

DAI

function DAI() external view returns (contract IERC20)

reference to the DAI contract used.

Router can be redeployed if DAI address changes

Returns

NameTypeDescription
_0contract IERC20undefined

FEI

function FEI() external view returns (contract IERC20)

reference to the FEI contract used.

Router can be redeployed if FEI address changes

Returns

NameTypeDescription
_0contract IERC20undefined

USDC_SCALING_FACTOR

function USDC_SCALING_FACTOR() external view returns (uint256)

scaling factor for USDC

Returns

NameTypeDescription
_0uint256undefined

core

function core() external view returns (contract ICore)

address of the Core contract referenced

Returns

NameTypeDescription
_0contract ICoreICore implementation address

daiPSM

function daiPSM() external view returns (contract IDSSPSM)

reference to the Maker DAI-USDC PSM that this router interacts with

points to Makers DssPsm contract

Returns

NameTypeDescription
_0contract IDSSPSMundefined

feiPSM

function feiPSM() external view returns (contract IPegStabilityModule)

reference to the FEI FEI-DAI PSM that this router interacts with

Returns

NameTypeDescription
_0contract IPegStabilityModuleundefined

isContractAdmin

function isContractAdmin(address _admin) external view returns (bool)

returns whether a given address has the admin role for this contract

Parameters

NameTypeDescription
_adminaddressundefined

Returns

NameTypeDescription
_0boolundefined

pause

function pause() external nonpayable

set pausable methods to paused

paused

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns

NameTypeDescription
_0boolundefined

setContractAdminRole

function setContractAdminRole(bytes32 newContractAdminRole) external nonpayable

sets a new admin role for this contract

Parameters

NameTypeDescription
newContractAdminRolebytes32undefined

swapAllFeiForDai

function swapAllFeiForDai(address to) external nonpayable

Function to swap all of FEI balance to DAI

Parameters

NameTypeDescription
toaddressthe address the DAI should be sent to once swapped

swapAllFeiForUsdc

function swapAllFeiForUsdc(address to) external nonpayable

Function to swap all of FEI balance to USDC

Parameters

NameTypeDescription
toaddressthe address the USDC should be sent to once swapped

swapAllFeiForUsdcAndDai

function swapAllFeiForUsdcAndDai(address usdcTo, address daiTo, uint256 ratioUSDC) external nonpayable

Function to swap all FEI balance for both DAI and USDC

Parameters

NameTypeDescription
usdcToaddressthe address the USDC should be sent to once swapped
daiToaddressthe address the DAI should be sent to once swapped
ratioUSDCuint256the ratio of the DAI received we would like to swap to USDC - in basis point terms

swapFeiForDai

function swapFeiForDai(uint256 amountFeiIn, uint256 minDaiAmountOut, address to) external nonpayable

Function to swap from FEI to DAI

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received
toaddressthe address the DAI should be sent to once swapped

swapFeiForUsdc

function swapFeiForUsdc(uint256 amountFeiIn, uint256 minDaiAmountOut, address to) external nonpayable

Function to swap from FEI to USDC

Function will swap from FEI to DAI first then DAI to USDC

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received from FEI PSM
toaddressthe address the USDC should be sent to once swapped

swapFeiForUsdcAndDai

function swapFeiForUsdcAndDai(uint256 amountFeiIn, uint256 minDaiAmountOut, address usdcTo, address daiTo, uint256 ratioUSDC) external nonpayable

Function to swap for both DAI and USDC

Function will swap from FEI to DAI first then DAI to USDC

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received
usdcToaddressthe address the USDC should be sent to once swapped
daiToaddressthe address the DAI should be sent to once swapped
ratioUSDCuint256the ratio of the DAI received we would like to swap to USDC - in basis point terms

unpause

function unpause() external nonpayable

set pausable methods to unpaused

vcon

function vcon() external view returns (contract IERC20)

address of the Tribe contract referenced by Core

Returns

NameTypeDescription
_0contract IERC20IERC20 implementation address

vconBalance

function vconBalance() external view returns (uint256)

vcon balance of contract

Returns

NameTypeDescription
_0uint256vcon amount held

volt

function volt() external view returns (contract IVolt)

address of the Fei contract referenced by Core

Returns

NameTypeDescription
_0contract IVoltIFei implementation address

voltBalance

function voltBalance() external view returns (uint256)

volt balance of contract

Returns

NameTypeDescription
_0uint256volt amount held

withdrawERC20

function withdrawERC20(address token, uint256 amount, address to) external nonpayable

Function to withdraw tokens to an address

Parameters

NameTypeDescription
tokenaddressthe token to withdraw
amountuint256the amount to send
toaddressthe address the token should be sent to

Events

ContractAdminRoleUpdate

event ContractAdminRoleUpdate(bytes32 indexed oldContractAdminRole, bytes32 indexed newContractAdminRole)

Parameters

NameTypeDescription
oldContractAdminRole indexedbytes32undefined
newContractAdminRole indexedbytes32undefined

CoreUpdate

event CoreUpdate(address indexed oldCore, address indexed newCore)

Parameters

NameTypeDescription
oldCore indexedaddressundefined
newCore indexedaddressundefined

Paused

event Paused(address account)

Parameters

NameTypeDescription
accountaddressundefined

Unpaused

event Unpaused(address account)

Parameters

NameTypeDescription
accountaddressundefined