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 180 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 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
f28b3dc
docs: add examples showing how to expose functions
0xNeshi Dec 16, 2024
19eb5b3
docs: put flash_loan errors in separate lines
0xNeshi Dec 16, 2024
59c7ed4
Squashed 'examples/solidity-contracts/' content from commit fad2b6e1
0xNeshi Dec 17, 2024
ca5cd03
Merge commit '59c7ed47f621733d8d14e9f67e7bd46e99525637' as 'examples/…
0xNeshi Dec 17, 2024
8ec7576
ref: add OZ solidity contracts as subtree in examples
0xNeshi Dec 17, 2024
1c5455d
revert: Turn All `Call::new_in` into `Call::new` (i.e. Stop Supportin…
0xNeshi Dec 18, 2024
4be5d7d
feat: reenable reentrancy
0xNeshi Dec 18, 2024
5b958d6
fix: uncomment logic in flash_loan
0xNeshi Dec 18, 2024
0b820fd
test: uncomment flash_loan happy path-related logic
0xNeshi Dec 18, 2024
a3531cc
docs: mention flash_loan can reenter
0xNeshi Dec 18, 2024
da262b1
docs: put errors in a list
0xNeshi Dec 18, 2024
2c8411a
docs: add missing notes for impling TopLevelStorage
0xNeshi Dec 18, 2024
e9ba127
chore: merge with upstream/main
0xNeshi Dec 19, 2024
8f5ac07
test: revert e2e changes
0xNeshi Dec 19, 2024
1be62a1
ref: update how reentrancy is enabled in safe_erc20 & for flash mint …
0xNeshi Dec 19, 2024
ee867fc
ref: remove gas assignment for SafeErc20
0xNeshi Dec 19, 2024
5f2f3f2
test: recompile ERC3156FlashBorrowerMock with Remix
0xNeshi Dec 19, 2024
4db1a6d
test: remove redundant sol contracts
0xNeshi Dec 19, 2024
d901db1
chore: reenable flash mint bench
0xNeshi Dec 19, 2024
7526985
revert reenable flash mint bench
0xNeshi Dec 19, 2024
488849e
revert: remove redundant sol contracts
0xNeshi Dec 19, 2024
012d941
revert: recompile ERC3156FlashBorrowerMock with Remix
0xNeshi Dec 19, 2024
93dc548
chore: uncomment borrower deployment
0xNeshi Dec 19, 2024
f7f2b60
revert: uncomment borrower deployment
0xNeshi Dec 19, 2024
f2c83d9
chore: in benches change receiver->borrower & update explaining comment
0xNeshi Dec 19, 2024
8e8c69c
docs: add comment to ERC3156FlashBorrowerMock that it's used in benches
0xNeshi Dec 19, 2024
639174c
chore: Merge remote-tracking branch 'upstream/main' into erc20flashMint
0xNeshi Dec 20, 2024
775bd83
test: move flash_loan_with_fee_and_fee_receiver up
0xNeshi Dec 20, 2024
ad83357
ref: _burn allowance value instead of amount+fee
0xNeshi Dec 20, 2024
3eda8ac
test: add more flash_loan tests
0xNeshi Dec 20, 2024
bf8e0c4
ref(test): rename _enableReturn->_validReturn
0xNeshi Dec 20, 2024
1f37b64
test: add cases for insufficient tokens to burn/transfer fees
0xNeshi Dec 20, 2024
4538ebc
test: Add case flash_loan_reverts_when_allowance_overflows
0xNeshi Dec 20, 2024
987d3a3
test: add happy flow cases with present/missing fee & fee receiver
0xNeshi Dec 20, 2024
f4d41e3
test: remove unused Erc1155 import in uri_storage
0xNeshi Dec 20, 2024
d0b5343
ref: remove redundant stylus-sdk version param in toml
0xNeshi Dec 20, 2024
d7cca49
docs: update e2e alloy links
0xNeshi Dec 20, 2024
c58b3a5
ci: fix linker issue with reentrancy enabled
0xNeshi Dec 20, 2024
86b98ee
chore: update CHANGELOG
0xNeshi Dec 20, 2024
ec467c2
ci: exclude examples from code coverage
0xNeshi Dec 20, 2024
c232c48
ci: fix coverage member filtering
0xNeshi Dec 20, 2024
1eab9a8
ci: remove nextest which targets erc20-flash-mint-example
0xNeshi Dec 20, 2024
41ecfae
docs: add link to issue related to commented bench
0xNeshi Dec 20, 2024
32528cb
ref: add missing '-example' to ownable-two-step package name
0xNeshi Dec 20, 2024
165ba8b
ci: fix filtered_members
0xNeshi Dec 20, 2024
546d35a
ci: inline members
0xNeshi Dec 20, 2024
d0f6a6e
ci: add comment about filtering examples from coverage
0xNeshi Dec 20, 2024
1ba51fb
ci: remove 'id' & add explanatory comments to filter out examples step
0xNeshi Dec 23, 2024
138690c
Merge branch 'main' into erc20flashMint
0xNeshi Dec 27, 2024
cd5eae8
ci: run unit tests only on contracts, contract-proc & lib/crypto
0xNeshi Dec 30, 2024
70a22a4
ci: fix openzeppelin-crypto name (removed redundant 'ro') in test.yml
0xNeshi Dec 30, 2024
5e59377
ci: ignore all non-contract-related packages from coverage
0xNeshi Dec 30, 2024
1420f9f
ref: remove coverage-related files
0xNeshi Dec 30, 2024
8de00af
chore: gitignore coverage-related files
0xNeshi Dec 30, 2024
59662e2
ci: revert lcov.info to be output-path for coverage
0xNeshi Dec 30, 2024
a8f2a67
test: remove benches + mock/borrower compiled with Remix
0xNeshi Dec 30, 2024
c32ee77
test: remove std feature from e2e-tests.sh
0xNeshi Dec 30, 2024
bd015a4
docs: use explicit alloy versions in links
0xNeshi Dec 30, 2024
083b125
test: rename erc20_flash_mint field -> flash_mint
0xNeshi Dec 30, 2024
880c03e
test: remove redundant balance_of reexport from example
0xNeshi Dec 30, 2024
0d5cedf
ref: move ReentrantCallHandler to shared utils
0xNeshi Dec 30, 2024
5357ee6
ci: return std feature
0xNeshi Dec 30, 2024
8a9ef13
test: remove dir navigation in e2e-tests.sh
0xNeshi Dec 31, 2024
40bb2d6
revert: remove dir navigation in e2e-tests.sh
0xNeshi Dec 31, 2024
7f5120e
ref: reexport ReentrantCallHandler directly from utils module
0xNeshi Dec 31, 2024
43fbe9a
docs: update link in adoc
0xNeshi Dec 31, 2024
20d253b
ref: align amount->value as in ERC20
0xNeshi Dec 31, 2024
9c89763
ref: max_flash_loan
0xNeshi Dec 31, 2024
6ff61c7
ref: flash_fee
0xNeshi Dec 31, 2024
d36efd0
docs: remove redundant comment in mock/borrower.rs
0xNeshi Dec 31, 2024
fb144c8
Merge branch 'main' into erc20flashMint
bidzyyys Jan 2, 2025
6e535e6
add a missing error section
qalisander Jan 3, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

# https://twitter.com/jonhoo/status/1571290371124260865
- name: Run unit tests
run: cargo nextest run --locked --features std --all-targets
run: cargo nextest run --locked --features std --all-targets -p openzeppelin-stylus -p openzeppelin-stylus-proc -p openzeppelin-crypto

# https://github.com/rust-lang/cargo/issues/6669
- name: Run doc tests
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
run: cargo generate-lockfile

- name: Run unit tests
run: cargo nextest run --locked --features std --all-targets
run: cargo nextest run --locked --features std --all-targets -p openzeppelin-stylus -p openzeppelin-stylus-proc -p openzeppelin-crypto
coverage:
# Use llvm-cov to build and collect coverage and outputs in a format that
# is compatible with codecov.io.
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
run: cargo generate-lockfile

- name: Cargo llvm-cov
run: cargo llvm-cov --locked --features std --lcov --output-path lcov.info
run: cargo llvm-cov --locked --features std --lcov --output-path lcov.info -p openzeppelin-stylus -p openzeppelin-stylus-proc -p openzeppelin-crypto

- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ docs/build/
**/.DS_Store

**/nitro-testnode

lcov.info

lcov.infos
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

-
- `Erc20FlashMint` extension. #407

### Changed

- Use `AddAssignUnchecked` and `SubAssignUnchecked` in `erc20::_update` calculations. #467
- Use `AddAssignUnchecked` and `SubAssignUnchecked` in `erc20::_update`. #467

### Changed (Breaking)

- `Nonce::use_nonce` now panics on exceeding `U256::MAX`. #467
- Add full support for reentrancy (changed `VestingWallet` signature for some functions). #407
0xNeshi marked this conversation as resolved.
Show resolved Hide resolved
- `Nonce::use_nonce` panics on exceeding `U256::MAX`. #467

### Fixed

Expand Down
15 changes: 14 additions & 1 deletion 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 @@ -7,6 +7,7 @@ members = [
"lib/e2e-proc",
"examples/erc20",
"examples/erc20-permit",
"examples/erc20-flash-mint",
"examples/erc721",
"examples/erc721-consecutive",
"examples/erc721-metadata",
Expand All @@ -31,6 +32,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
1 change: 1 addition & 0 deletions contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ rand.workspace = true
# features, because this crate is meant to be used in a `no_std` environment.
# Currently, the std feature is only used for testing purposes.
std = []
reentrant = ["stylus-sdk/reentrant"]

[lib]
crate-type = ["lib"]
Expand Down
18 changes: 11 additions & 7 deletions contracts/src/finance/vesting_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
///
/// # Arguments
///
/// * `&self` - Read access to the contract's state.
/// * `&mut self` - Write access to the contract's state.
/// * `token` - Address of the releasable token.
///
/// # Errors
Expand All @@ -266,7 +266,8 @@
/// If total allocation exceeds `U256::MAX`.
/// If scaled, total allocation (mid calculation) exceeds `U256::MAX`.
#[selector(name = "releasable")]
fn releasable_erc20(&self, token: Address) -> Result<U256, Self::Error>;
fn releasable_erc20(&mut self, token: Address)
-> Result<U256, Self::Error>;

/// Release the native tokens (Ether) that have already vested.
///
Expand Down Expand Up @@ -335,7 +336,7 @@
///
/// # Arguments
///
/// * `&self` - Read access to the contract's state.
/// * `&mut self` - Write access to the contract's state.
/// * `token` - Address of the token being released.
/// * `timestamp` - Point in time for which to check the vested amount.
///
Expand All @@ -350,13 +351,13 @@
/// If scaled, total allocation (mid calculation) exceeds `U256::MAX`.
#[selector(name = "vestedAmount")]
fn vested_amount_erc20(
&self,
&mut self,
token: Address,
timestamp: u64,
) -> Result<U256, Self::Error>;
}

#[public]

Check warning on line 360 in contracts/src/finance/vesting_wallet.rs

View workflow job for this annotation

GitHub Actions / nightly / doc

unexpected `cfg` condition value: `export-abi`

Check warning on line 360 in contracts/src/finance/vesting_wallet.rs

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / coverage

unexpected `cfg` condition value: `export-abi`

Check warning on line 360 in contracts/src/finance/vesting_wallet.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

unexpected `cfg` condition value: `export-abi`

Check warning on line 360 in contracts/src/finance/vesting_wallet.rs

View workflow job for this annotation

GitHub Actions / ubuntu / beta

unexpected `cfg` condition value: `export-abi`
impl IVestingWallet for VestingWallet {
type Error = Error;

Expand Down Expand Up @@ -410,7 +411,10 @@
}

#[selector(name = "releasable")]
fn releasable_erc20(&self, token: Address) -> Result<U256, Self::Error> {
fn releasable_erc20(
&mut self,
token: Address,
) -> Result<U256, Self::Error> {
let vested = self.vested_amount_erc20(token, block::timestamp())?;
// SAFETY: total vested amount is by definition greater than or equal to
// the released amount.
Expand Down Expand Up @@ -467,13 +471,13 @@

#[selector(name = "vestedAmount")]
fn vested_amount_erc20(
&self,
&mut self,
token: Address,
timestamp: u64,
) -> Result<U256, Self::Error> {
let erc20 = IErc20::new(token);
let balance = erc20
.balance_of(Call::new(), contract::address())
.balance_of(Call::new_in(self), contract::address())
.map_err(|_| InvalidToken { token })?;

let total_allocation = balance
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/token/erc1155/extensions/uri_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod tests {
use stylus_sdk::prelude::storage;

use super::Erc1155UriStorage;
use crate::token::erc1155::{extensions::Erc1155MetadataUri, Erc1155};
use crate::token::erc1155::extensions::Erc1155MetadataUri;

fn random_token_id() -> U256 {
let num: u32 = rand::random();
Expand Down
Loading
Loading