PieVaults are on the Diamond standard, this standard ensures contracts can grow beyond their restricted size. (extra info)
CallManagers are addresses which are whitelisted to trigger arbitrary calls from the ExperiPie. A whitelisted caller can be added by calling
addCaller(_newCaller) on the ExperiPie from the contract owner. ⚠️ This should be used with caution as it allows any token within an ExperiPie to be pulled out ⚠️. Only trusted addresses or smart contracts should be added as callers.
lendingManager allows the owner of that instance to withdraw and deposit tokens into lending lending protocols which are whitelisted in the
lendingRegistry. The owner of the
lendingManager instance can move tokens between whitelisted lending protocols in the
For a lending manager to be able to manage a ExperiPie's tokens it needs to be whitelisted as a caller.
The owner of the lending manager instance can
bounce(hopping between protocols).
These functions have the following interface and should be called on the Lending Manager contract.
/**@notice Move underlying to a lending protocol@param _underlying Address of the underlying token@param _amount Amount of underlying to lend@param _protocol Bytes32 protocol key to lend to*/function lend(address _underlying, uint256 _amount) bytes32 _protocol) public;/**@notice Unlend wrapped token from its lending protocol@param _wrapped Address of the wrapped token@param _amount Amount of the wrapped token to unlend*/function unlend(address _wrapped, uint256 _amount) public;/**@notice Unlend and immediately lend in a different protocol@param _wrapped Address of the wrapped token to bounce to another protocol@param _amount Amount of the wrapped token to bounce to the other protocol@param _toProtocol Protocol to deposit bounced tokens in*/function bounce(address _wrapped, uint256 _amount, bytes32 _toProtocol) external;
The lending registry keeps track of all lending protocols and wrapped tokens. Only tokens and protocols registered in this registry can be used by the
LendingManager. Currently supported lending protocols are Compound and Aave.
With the following functions protocols and wrapped tokens can be added:
/**@notice Set which protocl a wrapped token belongs to@param _wrapped Address of the wrapped token@param _protocol Bytes32 key of the protocol*/function setWrappedToProtocol(address _wrapped, bytes32 _protocol) external;/**@notice Set what is the underlying for a wrapped token@param _wrapped Address of the wrapped token@param _underlying Address of the underlying token*/function setWrappedToUnderlying(address _wrapped, address _underlying) external;/**@notice Set the logic contract for the protocol@param _protocol Bytes32 key of the procol@param _logic Address of the lending logic contract for that protocol*/function setProtocolToLogic(bytes32 _protocol, address _logic) external;/**@notice Set the wrapped token for the underlying deposited in this protocol@param _underlying Address of the unerlying token@param _protocol Bytes32 key of the protocol@param _wrapped Address of the wrapped token*/function setUnderlyingToProtocolWrapped(address _underlying, bytes32 _protocol, address _wrapped) external;
Lending logic contracts return the calls needed to lend or unlend from a protocol.
npx buidler deploy-pie-factory --network mainnet
Create an allocation file like this one
npx buidler deploy-pie-from-factory --allocation [PATH_TO_ALLOCATION] --factory [FACTORY_ADDRESS] --network mainnet
Copy the tx hash and search on Etherscan to find the address
Verify the contract:
npx buidler verify [PIE_ADDRESS] --constructor-args ./verify/experiPie.js --network mainnet