Partial implementation and requirements for liquidity routers.
boundMakerContracts
mapping(address => bool) boundMakerContracts
the bound maker contracts which are allowed to call this router.
This modifier verifies that msg.sender an allowed caller of this router.
modifier boundOrAdmin()
This modifier verifies that msg.sender is the admin or an allowed caller of this router.
event MakerBind(address maker)
logging bound maker contract
by emitting this data, an indexer will be able to keep track of what maker contracts are allowed to call this router.
the maker address. This is indexed, so that RPC calls can filter on it.
logging unbound maker contract
by emitting this data, an indexer will be able to keep track of what maker contracts are allowed to call this router.
the maker address. This is indexed, so that RPC calls can filter on it.
getter for the makers: addr => bool mapping
the address of a maker contract
true if mkr is authorized to call this router.
pulls liquidity from the reserve and sends it to the calling maker contract.
is the ERC20 managing the pulled asset
identifies the fund owner (router implementation dependent).
of token the maker contract wishes to pull from its reserve
when the calling maker contract accepts to receive more funds from reserve than required (this may happen for gas optimization)
the amount that was successfully pulled.
router-dependent implementation of the pull function
determines the location of the reserve (router implementation dependent).
The amount of tokens to be transferred
wether the caller maker contract wishes to pull at most amount tokens of owner.
pulled The amount pulled if successful; otherwise, 0.
pushes assets from calling's maker contract to a reserve
is the asset the maker is pushing
determines the location of the reserve (router implementation dependent).
is the amount of asset that should be transferred from the calling maker contract
fraction of amount that was successfully pushed to reserve.
router-dependent implementation of the push function
determines the location of the reserve (router implementation dependent).
The amount of tokens to be transferred
The amount pushed if successful; otherwise, 0.
iterative push for the whole balance in a single call
determines the location of the reserve (router implementation dependent).
adds a maker contract address to the allowed makers of this router
this function is callable by router's admin to bootstrap, but later on an allowed maker contract can add another address
the maker contract address
removes a maker contract address from the allowed makers of this router
the maker contract address
removes msg.sender from the allowed makers of this router
removes a makerContract from the allowed makers of this router
the maker contract address
allows a makerContract to verify it is ready to use this router for a particular reserve
checkList returns normally if all needed approval are strictly positive. It reverts otherwise with a reason.
is the asset (and possibly its overlyings) whose approval must be checked
of the tokens that are being pulled
router-dependent additional checks
is the asset (and possibly its overlyings) whose approval must be checked
of the tokens that are being pulled
performs necessary approval to activate router function on a particular asset
the asset one wishes to use the router for
router-dependent implementation of the activate function
the asset one wishes to use the router for
balanceOfReserve
Balance of a reserve
the asset one wishes to know the balance of
the identifier of the reserve
the balance of the reserve