This repository contains the core smart contracts for the Isle Protocol. In-depth documentation is available at docs.isle.finance
-
If you are on VS Code, install Nomicfoundation/hardhat-solidity or JuanBlanco/solidity (select one for solidity) and Tamasfe/even-better-toml as extensions. (Learn more)
-
Install npm packages
pnpm install
-
Install foundry libraries
forge install
Isle Protocol is a designed where each pool will be a set of contracts
PoolAddressesProvider
LoanManager
WithdrawalManager
PoolConfigurator
Pool
That is to say, each pool will have its own set of contracts so as to maximize customisability for pool admins. Please see the following diagrams to have a better view of the design and flow.
This is a list of the most frequently needed commands.
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Compile the contracts:
$ forge build
Get a test coverage report:
$ forge coverage
Get a .lcov coverage report
$ forge coverage --report lcov
Deploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
$ forge snapshot
$ pnpm gas-report
Format the contracts:
$ forge fmt
Get a gas report:
$ forge test --gas-report
Lint the contracts:
$ pnpm lint
Run the tests:
$ forge test
View balance of address
cast balance --rpc-url "sepolia" -e $ADDRESS
Send ETH to another address
cast send $ADDRESS --rpc-url "sepolia" --value 0.1ether --private-key $PRIV_KEY
Run deploy scripts
forge script scripts/DeployERC20Mint.s.sol --rpc-url "$RPC_URL" --sender "$SENDER" --broadcast --sig "run()" --verify -vvvv
forge script scripts/DeployCore.s.sol --rpc-url "$RPC_URL" --sender "$SENDER" --broadcast --sig "run(address)" --verify -vvvv "$ADDRESS"
forge script scripts/Init.s.sol --rpc-url "$RPC_URL" --sender "$SENDER" --broadcast --sig "run(address,address)" --verify -vvvv "$RECEIVABLE" "$PAP"
Run Anvil with specified Mnemonic
anvil -m "$MNEMONIC"
Get crurrent gas price in gwei
cast to-unit $(cast gas-price) gwei
- IsleUSD:
0xD7719799520b89A6b934A4402388e9EDdFD85387
- Receivable:
0x497918fD3227835184Af0D8fCc106E5e70BBc881
- Deployer:
0xBbC9928618b05356841a8565C72E4493D12ad163
- IsleGlobals:
0xd5175C76F5a129De4F53b0DF5c878706E31910a1
- PoolAddressesProvider:
0x454Bc3c86aB284F2Aa7A746733B23B46866FbeDB
- WithdrawalManager:
0x7F5abDad0A9ee5Fbdf0B07F4Cf007F88783f14E5
- LoanManager:
0x1a16F4f4805197DF48Cc898f97601CE97B13d4a4
- PoolConfigurator:
0x389dE947656Fd0E2C806254Ad3fD9Ae4Ef297cDE
- Receivable:
0x103d37376F312C0D3FA4021351dC87811E0464B2
- IsleGlobals:
0x359f8Cfc8EadB4acB591211B73F5968b9900dB06
- WithdrawalManager:
0x9EDe7Fa06de4CcF3be5e26e27120eb608D001Ed8
- LoanManager:
0x5a0a72f2c0a28161d33e7bd56191ab2ed1a629e3
- PoolConfigurator:
0x4137b1072c18F50D8D5f883043712727efa7B038
- Deployer:
0xBbC9928618b05356841a8565C72E4493D12ad163
- Receivable:
0x44dad751B53a250504E2D10EAeB52125Ba49669F
- IsleGlobals:
0x0e7349cbcbA4d5394E51ae8B227a0f7D5ae3333c
- PoolAddressesProvider:
0xA3619929d8938f575EA68C7C70B7cAee435D84C9
- WithdrawalManager:
0x51AE66d95dD7795F733136aD6A922c918C48d84D
- LoanManager:
0xfc69FbC4087Bc9d0F13E323E2Fa2C19cb03D4473
- PoolConfigurator:
0x46bEF0D0cb6FB24F535161Aa4dB4d023E3776009
- Receivable:
0x2ce499A1e349a0471ec7d99F64B4F6b8F7834e13
- IsleGlobals:
0x0b2BdD04D12f4Fc7d4a45100cE3dC10605b44B00
- WithdrawalManager:
0xAB547866E27EE06A6Cd038DFb1b2c26eD4bE27C4
- LoanManager:
0xc30cbf90EB98091387681bC7B3438aEF08DfA3CE
- PoolConfigurator:
0xf9EF7D9f9cE186b99499b3b8BBB0391042406AC4
forge verify-contract \
--chain-id 11155111 \
--num-of-optimizations 1000 \
--watch \
${Address} \
contracts/Receivable.sol:Receivable
See Foundry Book
forge verify-contract \
--chain-id 11155111 \
--num-of-optimizations 1000 \
--watch \
--constructor-args $(cast abi-encode "constructor(address)" ${ARG}) \
${Address} \
contracts/WithdrawalManager.sol:WithdrawalManager
forge verify-contract \
--chain-id 11155111 \
--num-of-optimizations 1000 \
--watch \
--constructor-args $(cast abi-encode "constructor(address)" ${ARG}) \
--libraries contracts/libraries/${Library}.sol:${Library}:${Address} \
${Address} \
contracts/PoolConfigurator.sol:PoolConfigurator