-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added function to set lenders * fix: removed extra line * feat: added migrators for debtLOcker * feat: created debt locker v4 * fix: removed extra line * Update IDebtLocker.sol * Update DebtLocker.t.sol * chore: move submodules to ssh * fix: add forge support, fix ci * fix: update yaml * fix: add gitignore * Delete solidity-files-cache.json Co-authored-by: Lucas Manuel <lucas@maple.finance>
- Loading branch information
1 parent
3cd47a3
commit b357978
Showing
32 changed files
with
391 additions
and
282 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Forge Tests (PR) | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Checkout liquidations private submodule | ||
env: | ||
SSH_KEY_LIQUIDATIONS: ${{secrets.SSH_KEY_LIQUIDATIONS}} | ||
shell: bash | ||
run: | | ||
mkdir $HOME/.ssh | ||
echo "$SSH_KEY_LIQUIDATIONS" > $HOME/.ssh/id_rsa | ||
chmod 600 $HOME/.ssh/id_rsa | ||
git submodule update --init --recursive modules/liquidations | ||
- name: Checkout loan private submodule | ||
env: | ||
SSH_KEY_LOAN: ${{secrets.SSH_KEY_LOAN}} | ||
shell: bash | ||
run: | | ||
echo "$SSH_KEY_LOAN" > $HOME/.ssh/id_rsa | ||
chmod 600 $HOME/.ssh/id_rsa | ||
git submodule update --init --recursive modules/loan | ||
- name: Checkout public submodules | ||
run: | | ||
git config --global url."https://github.com/".insteadOf "git@github.com:" | ||
git submodule update --init --recursive | ||
- name: Run Forge tests | ||
run: ./scripts/test.sh -p deep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Forge Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Checkout liquidations private submodule | ||
env: | ||
SSH_KEY_LIQUIDATIONS: ${{secrets.SSH_KEY_LIQUIDATIONS}} | ||
shell: bash | ||
run: | | ||
mkdir $HOME/.ssh | ||
echo "$SSH_KEY_LIQUIDATIONS" > $HOME/.ssh/id_rsa | ||
chmod 600 $HOME/.ssh/id_rsa | ||
git submodule update --init --recursive modules/liquidations | ||
- name: Checkout loan private submodule | ||
env: | ||
SSH_KEY_LOAN: ${{secrets.SSH_KEY_LOAN}} | ||
shell: bash | ||
run: | | ||
echo "$SSH_KEY_LOAN" > $HOME/.ssh/id_rsa | ||
chmod 600 $HOME/.ssh/id_rsa | ||
git submodule update --init --recursive modules/loan | ||
- name: Checkout public submodules | ||
run: | | ||
git config --global url."https://github.com/".insteadOf "git@github.com:" | ||
git submodule update --init --recursive | ||
- name: Run Forge tests | ||
run: ./scripts/test.sh -p super_deep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ hevm* | |
artifacts/* | ||
docs/* | ||
metadata.json | ||
cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
[submodule "modules/erc20"] | ||
path = modules/erc20 | ||
url = https://github.com/maple-labs/erc20.git | ||
url = git@github.com:maple-labs/erc20.git | ||
[submodule "modules/erc20-helper"] | ||
path = modules/erc20-helper | ||
url = https://github.com/maple-labs/erc20-helper.git | ||
url = git@github.com:maple-labs/erc20-helper.git | ||
[submodule "modules/contract-test-utils"] | ||
path = modules/contract-test-utils | ||
url = https://github.com/maple-labs/contract-test-utils.git | ||
url = git@github.com:maple-labs/contract-test-utils.git | ||
[submodule "modules/liquidations"] | ||
path = modules/liquidations | ||
url = https://github.com/maple-labs/liquidations | ||
url = git@github.com:maple-labs/liquidations.git | ||
[submodule "modules/maple-proxy-factory"] | ||
path = modules/maple-proxy-factory | ||
url = git@github.com:maple-labs/maple-proxy-factory.git | ||
[submodule "modules/loan"] | ||
path = modules/loan | ||
url = https://github.com/maple-labs/loan | ||
url = git@github.com:maple-labs/loan.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
prod :; ./build.sh -c ./config/prod.json | ||
dev :; ./build.sh -c ./config/dev.json | ||
ci :; ./build.sh -c ./config/ci.json | ||
clean :; dapp clean | ||
test :; ./test.sh | ||
release :; ./release.sh | ||
install: | ||
@git submodule update --init --recursive | ||
|
||
update: | ||
@forge update | ||
|
||
build: | ||
@scripts/build.sh -p default | ||
|
||
test: | ||
@scripts/test.sh | ||
|
||
clean: | ||
@forge clean |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
name: debt-locker | ||
version: 2.0.0 | ||
version: 4.0.0-alpha.0 | ||
source: contracts | ||
packages: | ||
- path: contracts/DebtLocker.sol | ||
contractName: DebtLocker | ||
customChecksum: 0x852d096582581e400aa000467ea9e59e7939c20e4cbbfe0c0f3d04ac4286f600 | ||
- path: contracts/DebtLockerFactory.sol | ||
contractName: DebtLockerFactory | ||
customChecksum: 0x90aa9362f8cf6d72464bb112ecddba515337250c33bff5c86e55831f005776d3 | ||
- path: contracts/DebtLockerInitializer.sol | ||
contractName: DebtLockerInitializer | ||
customChecksum: 0xc47b9628c0eaa75890eaced74c259ae3613b4cb0f5090a2925c2fae166f59486 | ||
customDescription: Maple Debt Locker Artifacts and ABIs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity 0.8.7; | ||
|
||
import { IDebtLockerV4Migrator } from "./interfaces/IDebtLockerV4Migrator.sol"; | ||
|
||
import { DebtLockerStorage } from "./DebtLockerStorage.sol"; | ||
|
||
/// @title DebtLockerV4Migrator is intended to initialize the storage of a DebtLocker proxy. | ||
contract DebtLockerV4Migrator is IDebtLockerV4Migrator, DebtLockerStorage { | ||
|
||
function encodeArguments(address migrator_) external pure override returns (bytes memory encodedArguments_) { | ||
return abi.encode(migrator_); | ||
} | ||
|
||
function decodeArguments(bytes calldata encodedArguments_) public pure override returns (address migrator_) { | ||
( migrator_ ) = abi.decode(encodedArguments_, (address)); | ||
} | ||
|
||
fallback() external { | ||
|
||
// Taking the migrator_ address as argument for now, but ideally this would be hardcoded in the debtLocker migrator registered in the factory | ||
( address migrator_ ) = decodeArguments(msg.data); | ||
|
||
_loanMigrator = migrator_; | ||
} | ||
|
||
} |
Oops, something went wrong.