Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ERC20FlashMint extension #407

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
ab91bbe
chore: Implemented ERC3156FlashLender and ERC3156FlashBorrower
Ifechukwudaniel Nov 13, 2024
7862012
chore: removed lender
Ifechukwudaniel Nov 14, 2024
a7c0160
chore: flashmint
Ifechukwudaniel Nov 14, 2024
70d67a1
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 14, 2024
47053bc
chore : cargo format
Ifechukwudaniel Nov 14, 2024
6ea75eb
Update contracts/src/token/erc20/extensions/flashmint.rs
Ifechukwudaniel Nov 14, 2024
53ee21a
Update contracts/src/token/erc20/extensions/flashmint.rs
Ifechukwudaniel Nov 14, 2024
3bd25cf
chore: added docs for IERC3156FlashBorrower
Ifechukwudaniel Nov 14, 2024
b9cce5d
chore: docs
Ifechukwudaniel Nov 14, 2024
03f6f38
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 15, 2024
6aa5b6d
Create erc20-flashloan.adoc
Ifechukwudaniel Nov 15, 2024
ebee8d5
Merge pull request #1 from Ifechukwudaniel/patch-1
Ifechukwudaniel Nov 15, 2024
55672f6
chore: removed flashlaon and smaller changes
Ifechukwudaniel Nov 16, 2024
626ae03
chore: cargo format
Ifechukwudaniel Nov 16, 2024
f8cdcf2
chore: abi and constructor
Ifechukwudaniel Nov 16, 2024
85e62b1
chore: flashloan example setup
Ifechukwudaniel Nov 16, 2024
5feeb90
chore: changed erc20FlashMint to erc20FlashMint
Ifechukwudaniel Nov 17, 2024
47aad90
chore: erc20flashmint example
Ifechukwudaniel Nov 17, 2024
99a8089
chore: mock, abi and initial e2e test
Ifechukwudaniel Nov 17, 2024
1b20ea6
chore: created Erc3156FlashBorrowerMock
Ifechukwudaniel Nov 18, 2024
4d08485
chore: minor changes
Ifechukwudaniel Nov 18, 2024
c3271bf
chore: cargo fmt fix
Ifechukwudaniel Nov 18, 2024
fc229cd
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 19, 2024
890807d
chore: uint test
Ifechukwudaniel Nov 20, 2024
ea3a9b3
chore: smaller fixes
Ifechukwudaniel Nov 20, 2024
93fb0c0
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 20, 2024
53afee1
chore : e2e flashmints
Ifechukwudaniel Nov 20, 2024
e464bf2
chore: smaller changes
Ifechukwudaniel Nov 20, 2024
51dc8f1
Merge branch 'main' into erc20flashMint
0xNeshi Nov 25, 2024
c2fac88
Merge branch 'main' into erc20flashMint
bidzyyys Nov 25, 2024
5b27cc8
chore: smaller changes
Ifechukwudaniel Nov 26, 2024
258a081
chore: changes
Ifechukwudaniel Nov 26, 2024
4c660b3
Merge remote-tracking branch 'origin/erc20flashMint' into commites
Ifechukwudaniel Nov 26, 2024
857f437
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 26, 2024
170705c
Update contracts/src/token/erc20/utils/borrower.rs
Ifechukwudaniel Nov 27, 2024
407f1be
chore: removed map_err
Ifechukwudaniel Nov 27, 2024
46461b3
Merge branch 'main' into erc20flashMint
Ifechukwudaniel Nov 28, 2024
2a82b48
Merge branch 'main' into erc20flashMint
bidzyyys Dec 2, 2024
24af658
Merge branch 'main' into erc20flashMint
bidzyyys Dec 7, 2024
3aeec73
Merge branch 'main' into erc20flashMint
0xNeshi Dec 10, 2024
453ba76
Merge branch 'main' into erc20flashMint
0xNeshi Dec 11, 2024
a960494
ref: move IERC3156FlashBorrower to flashmint.rs
0xNeshi Dec 11, 2024
19cc761
ref: use explicit calculation for RETURN_VALUE
0xNeshi Dec 11, 2024
06cf66b
ref: loan_return checks
0xNeshi Dec 11, 2024
d8937fb
ref: loan_reciver->loan_receiver
0xNeshi Dec 11, 2024
6ef605b
ref: remove unused imports
0xNeshi Dec 11, 2024
1014473
chore: update CHANGELOG
0xNeshi Dec 11, 2024
c5d6902
docs: rename erc20-flashloan->erc20-flashmint
0xNeshi Dec 11, 2024
69f5f7c
test: format & recompile examples
0xNeshi Dec 11, 2024
407528c
ref: reorder items to follow convention
0xNeshi Dec 11, 2024
d58c61e
test: move _totalSupply closer to other erc20 fields
0xNeshi Dec 11, 2024
135e734
feat: make it necessary to reexport all flashmint functions
0xNeshi Dec 11, 2024
cddfdc8
ref: rename fn params & format abi
0xNeshi Dec 11, 2024
d4f6b92
ref: rename example pkg name
0xNeshi Dec 11, 2024
ef0c997
test: update ctr param names
0xNeshi Dec 11, 2024
6c1aa13
test: comment out all tests + fix constructs test
0xNeshi Dec 11, 2024
fe55262
ref: use 'flash-mint' instead of 'flashmint'
0xNeshi Dec 11, 2024
be1c2cd
test: fix e2e test
0xNeshi Dec 11, 2024
d811a86
test: add max_flash_loan tests
0xNeshi Dec 11, 2024
b64a4c7
test: add flash_fee e2e tests
0xNeshi Dec 11, 2024
c683576
test: comment out motsu tests
0xNeshi Dec 11, 2024
6a36500
test: add additional max_loan test
0xNeshi Dec 11, 2024
ed9ef12
chore: remove duplicate Erc1155Supply entry in CHANGELOG
0xNeshi Dec 12, 2024
8ff508c
test: remove temp result var in example
0xNeshi Dec 12, 2024
2600073
ref: loan_return fetching
0xNeshi Dec 12, 2024
9032bcf
test: remove clippy::too_many_args from abi/mod.rs
0xNeshi Dec 12, 2024
f1d5af5
fix: flash_loan should set itself as the spender of receiver's allowance
0xNeshi Dec 12, 2024
be411a5
test: pass ctro params to borrower contract in deploy fn
0xNeshi Dec 12, 2024
12815ce
fix: flash_loan receiver check
0xNeshi Dec 12, 2024
bf57370
test: temporary update e2e-tests.sh
0xNeshi Dec 12, 2024
53f7472
wip: debugging flash_loan
0xNeshi Dec 12, 2024
d5b2cd9
revert: wip debugging flash_loan
0xNeshi Dec 12, 2024
ac09c0f
tests: Add flash_loan tests
0xNeshi Dec 12, 2024
23c0fc2
Merge branch 'main' into erc20flashMint
bidzyyys Dec 12, 2024
574eeb0
docs: update contract & error comments
0xNeshi Dec 12, 2024
508030e
docs: update IERC3156FlashBorrower comment
0xNeshi Dec 12, 2024
72e09c9
ref: IERC3156FlashLender->IErc3156FlashLender + max_flash_loan + flas…
0xNeshi Dec 12, 2024
c2aabea
docs: add comment to flash_loan
0xNeshi Dec 12, 2024
26e41fd
ref: RETURN_VALUE->BORROWER_CALLBACK_VALUE
0xNeshi Dec 12, 2024
c0c6884
docs: add missing self arg to flash_loan comment
0xNeshi Dec 12, 2024
55a9bdf
docs: add adoc
0xNeshi Dec 12, 2024
eaeacf1
ref: cargo fmt
bidzyyys Dec 12, 2024
07dde6e
ref: make E2E tests compile again
bidzyyys Dec 12, 2024
a778b0f
Update CHANGELOG.md
Ifechukwudaniel Dec 12, 2024
10519ae
fix: E2E tests pass
bidzyyys Dec 13, 2024
f36b79a
docs: separate Flash & Lender
0xNeshi Dec 13, 2024
c6c508a
test: remove unused ERC3156FlashBorrowerMock import
0xNeshi Dec 13, 2024
9e49f1f
test: fix flash_loan_with_fee_and_fee_receiver
0xNeshi Dec 13, 2024
2819d56
revert: remove unused ERC3156FlashBorrowerMock import
0xNeshi Dec 13, 2024
ff3a660
test: happy flow > assert Transfer is emitted
0xNeshi Dec 13, 2024
f1c0b0d
ref: use erc1155supply-like design
0xNeshi Dec 13, 2024
b12a0c0
ref: ignore sol types from coverage
0xNeshi Dec 13, 2024
d87116a
revert: no longer use erc1155supply-like design
0xNeshi Dec 13, 2024
5c97ace
test: comment out happy flow flash_loan test
0xNeshi Dec 13, 2024
bfd609f
fix: uncomment flash_loan logic
0xNeshi Dec 13, 2024
cec3edf
docs: add comment above flash mint motsu tests
0xNeshi Dec 13, 2024
1498f62
test: revert changes to e2e-tests.sh
0xNeshi Dec 13, 2024
f32a2e6
docs: add missing fn params
0xNeshi Dec 13, 2024
6caf2c2
ref: revert formatting in ERC1155ReceiverMock.sol
0xNeshi Dec 13, 2024
b26bc19
fix: add missing checked_add when spending allowance
0xNeshi Dec 13, 2024
7cf54a7
docs: add panics section to flash_loan
0xNeshi Dec 13, 2024
731f3f9
docs: add missing event Approval docs to _spend_allowance
0xNeshi Dec 13, 2024
1f3115a
docs: add events section to flash_loan
0xNeshi Dec 13, 2024
d46a3a0
docs: add comment explaining BORROWER_CALLBACK_VALUE
0xNeshi Dec 13, 2024
5eb8ee5
test: refactor flash_loan_reverts_when_invalid_receiver
0xNeshi Dec 13, 2024
6d6a733
test: uncomment borrower mock code
0xNeshi Dec 13, 2024
b1f0ff7
chore: add benches
0xNeshi Dec 13, 2024
29aa069
test: uncomment unit tests & ignore them
0xNeshi Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `IErc3156FlashLender` extension. #407
Ifechukwudaniel marked this conversation as resolved.
Show resolved Hide resolved
- `Erc1155Supply` extension. #418
- `Erc1155Pausable`extension. #432
- `Erc1155UriStorage` extension. #431
Expand Down
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"lib/e2e-proc",
"examples/erc20",
"examples/erc20-permit",
"examples/erc20-flash-mint",
"examples/erc721",
"examples/erc721-consecutive",
"examples/erc721-metadata",
Expand All @@ -35,6 +36,7 @@ default-members = [
"lib/e2e-proc",
"examples/erc20",
"examples/erc20-permit",
"examples/erc20-flash-mint",
"examples/erc721",
"examples/erc721-consecutive",
"examples/erc721-metadata",
Expand Down
Loading