Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
e430211
wip
pgherveou Jul 2, 2025
b8edd12
fix build & test not handling dust yet
pgherveou Jul 2, 2025
a7adc71
add transfer_with dust
pgherveou Jul 2, 2025
578a11a
fix transfer_with_dust
pgherveou Jul 2, 2025
56eabf0
fix tests
pgherveou Jul 3, 2025
9b6f39f
use evm_balance where possible
pgherveou Jul 3, 2025
b34ebcf
port test from design
pgherveou Jul 3, 2025
c35e909
fix runtime-api macro
pgherveou Jul 3, 2025
d168cd4
fix missing test
pgherveou Jul 3, 2025
e357c74
fix benchmark tests
pgherveou Jul 3, 2025
d1d981c
Use U256 in bare_*
pgherveou Jul 4, 2025
01a91c6
make test pass again
pgherveou Jul 4, 2025
179b829
fix proc-acro
pgherveou Jul 4, 2025
b5d6bed
use native_value for clarity in tests
pgherveou Jul 4, 2025
2c05cfe
Add benchmark for eth_ extrinsics
pgherveou Jul 4, 2025
b2f3301
create the account if it does not exists
pgherveou Jul 4, 2025
18108f7
fix
pgherveou Jul 4, 2025
68e4ae4
fixes
pgherveou Jul 4, 2025
7f650f3
fixes
pgherveou Jul 4, 2025
380a1b4
fix build
pgherveou Jul 5, 2025
e0e5316
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Jul 5, 2025
8c21f11
Fix seal_call benchmark
pgherveou Jul 6, 2025
8158cea
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Jul 6, 2025
215e8a3
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Jul 6, 2025
a2aa1a1
Merge branch 'master' into pg/fix-seal-call-weights
pgherveou Jul 7, 2025
0c6059f
Merge branch 'pg/fix-seal-call-weights' into pg/eth-decimals
pgherveou Jul 7, 2025
be98709
fixes
pgherveou Jul 7, 2025
66d14f8
add migration
pgherveou Jul 7, 2025
cb06489
get rid of dust_account_id
pgherveou Jul 7, 2025
1edd2c2
fixes
pgherveou Jul 7, 2025
7840bdd
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Jul 7, 2025
3631e90
lint fix
pgherveou Jul 7, 2025
c387d13
nit updates
pgherveou Jul 7, 2025
e9e6038
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Jul 7, 2025
3ce1df7
fix pallet-xcm test
pgherveou Jul 8, 2025
a1d9b7c
fix build err
pgherveou Jul 8, 2025
3f27159
fix assets precompible build
pgherveou Jul 8, 2025
e3403f3
fix
pgherveou Jul 8, 2025
5b9c6ed
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Jul 8, 2025
f386278
Merge branch 'master' into pg/eth-decimals
pgherveou Jul 9, 2025
5f7adfa
pallet-xcm
pgherveou Jul 9, 2025
0cae21f
Update bench tests
pgherveou Jul 9, 2025
8a11d71
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Jul 9, 2025
74cb003
Update cargo files
pgherveou Jul 16, 2025
fc31a0e
store the runtime code for EVM instantiate
pgherveou Jul 16, 2025
bf2c046
wip
pgherveou Jul 17, 2025
4c3c09f
wip
pgherveou Jul 17, 2025
279c132
fix
pgherveou Jul 17, 2025
9e7ee08
fix
pgherveou Jul 17, 2025
a37dd15
PR review move has_dust and has_balance and remove pub
pgherveou Jul 18, 2025
a764344
use local function instead of closure
pgherveou Jul 18, 2025
6eb87c8
make migration
pgherveou Jul 18, 2025
2959185
scope function
pgherveou Jul 18, 2025
41c7afd
charge 0 for input_data_len on err
pgherveou Jul 18, 2025
e74ed21
comment bench_map
pgherveou Jul 18, 2025
2d8d417
use drain to remove old storage in migration
pgherveou Jul 18, 2025
bdc1365
make balance, dust private in BalanceWithDust
pgherveou Jul 18, 2025
c94be4f
Update substrate/frame/revive/src/migrations/v1.rs
pgherveou Jul 18, 2025
7d3bca0
Revert "Update substrate/frame/revive/src/migrations/v1.rs"
pgherveou Jul 18, 2025
a2a5a18
add migration unit test
pgherveou Jul 18, 2025
0dc2210
typo
pgherveou Jul 18, 2025
e8ca9fb
Add additional tests
pgherveou Jul 18, 2025
1da95a2
Merge branch 'master' into pg/eth-decimals
pgherveou Jul 18, 2025
7e9f2c9
Merge branch 'pg/eth-decimals' into pg/revm
pgherveou Jul 18, 2025
874e7c0
update lock
pgherveou Jul 18, 2025
d7eb888
wip
pgherveou Jul 19, 2025
38c2b80
add instructions
pgherveou Jul 20, 2025
a55cc7a
wip
pgherveou Jul 20, 2025
3a42cf7
split evm / pvm
pgherveou Jul 20, 2025
8af812d
basic host interaction
pgherveou Jul 20, 2025
165b7e7
fix gas
pgherveou Jul 21, 2025
ec3d84f
Merge branch 'master' into pg/revm
pgherveou Jul 22, 2025
ade709b
wip
pgherveou Jul 22, 2025
65ddd58
update lock
pgherveou Jul 22, 2025
006cb15
fix
pgherveou Jul 22, 2025
c3ff24a
rm
pgherveou Jul 22, 2025
661d251
fix
pgherveou Jul 22, 2025
8b55fe8
Update
pgherveou Jul 22, 2025
8335340
fix
pgherveou Jul 22, 2025
538bf49
comment bitwise test for now
pgherveou Jul 22, 2025
70d07b9
Add AllowEVMBytecode config
pgherveou Jul 22, 2025
364201c
wip
pgherveou Jul 23, 2025
a2edcbe
fix compile error
pgherveou Jul 23, 2025
97c00f4
fixes
pgherveou Jul 23, 2025
6edb4a1
use 0 value
pgherveou Jul 23, 2025
053c548
[pallet-revive] revm tests scaffolding (#9290)
xermicus Jul 24, 2025
b45b1a2
move back fixture to fixtures folder and generate them from build.rs
pgherveou Jul 24, 2025
27b62f7
add skeleton for fixtures
pgherveou Jul 24, 2025
acf0e6e
wip
pgherveou Jul 25, 2025
f47d7b5
fixes
pgherveou Jul 25, 2025
31c0595
update build.rs
pgherveou Jul 25, 2025
3a07569
nit
pgherveou Jul 25, 2025
9adf741
fixes
pgherveou Jul 26, 2025
b1dbf5d
add missing headers
pgherveou Jul 26, 2025
4341d6d
Merge branch 'master' into pg/revm
pgherveou Jul 27, 2025
91e59e5
add test allow_evm_bytecode_config_works
pgherveou Jul 27, 2025
da7473d
fix lock
pgherveou Jul 27, 2025
df8d71d
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Jul 27, 2025
359b181
fixes
pgherveou Jul 27, 2025
58b9220
Rve/revm arithmetic instructions WIP (#9361)
0xRVE Jul 30, 2025
5b304a0
fixes gas computation of evm arithemtic instructions (#9379)
0xRVE Jul 30, 2025
8817d7e
Revert "fixes gas computation of evm arithemtic instructions (#9379)"
Aug 12, 2025
02198ce
Revert "Rve/revm arithmetic instructions WIP (#9361)"
Aug 12, 2025
bb14f1c
[pallet-revive] do not silently fail Solidity fixtures compilation (#…
xermicus Aug 12, 2025
1bfbaa8
refactor more benchmarks
pgherveou Aug 14, 2025
7f79d2e
Merge branch 'master' into pg/revm
pgherveou Aug 18, 2025
076246c
Merge branch 'master' into pg/revm
pgherveou Aug 18, 2025
b2ceaae
revm file shuffling
pgherveou Aug 18, 2025
7e68c51
fixes
pgherveou Aug 18, 2025
6ec1681
rm stuff for later
pgherveou Aug 18, 2025
c89d026
rm evm
pgherveou Aug 18, 2025
d53e0ac
rm evm stuff
pgherveou Aug 18, 2025
edde1d1
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 18, 2025
4f38703
rm
pgherveou Aug 18, 2025
ab3761e
taplo fix
pgherveou Aug 18, 2025
7dadbc1
fix up cargo.lock
pgherveou Aug 18, 2025
abcd13c
try
pgherveou Aug 18, 2025
6d30298
fixes
pgherveou Aug 18, 2025
68e9a84
Merge branch 'master' into pg/revm-base
pgherveou Aug 18, 2025
551c711
rm vm/runtime.rs
pgherveou Aug 18, 2025
2c308d7
Merge branch 'pg/revm-base' into pg/revm
pgherveou Aug 18, 2025
2debf91
fix
pgherveou Aug 18, 2025
0175328
nit
pgherveou Aug 18, 2025
59e59e8
fixes
pgherveou Aug 18, 2025
f1f2ffc
nit
pgherveou Aug 18, 2025
82ea9bc
update call_with_code_per_byte
pgherveou Aug 18, 2025
20511d1
fixes
pgherveou Aug 18, 2025
e1bbcb9
added migration
pgherveou Aug 18, 2025
78c92d3
Merge branch 'master' into pg/revm-base
pgherveou Aug 19, 2025
3789665
Merge branch 'pg/revm-base' into pg/revm
pgherveou Aug 19, 2025
f8da76f
refactoring
pgherveou Aug 19, 2025
b1b1192
fix clippy
pgherveou Aug 19, 2025
a829fab
fix clippy
pgherveou Aug 19, 2025
3c4f5c4
Merge branch 'master' into pg/revm
pgherveou Aug 21, 2025
953ee61
merge fix
pgherveou Aug 21, 2025
7cee5be
simplify migration tests
pgherveou Aug 21, 2025
b8dc717
add migration
pgherveou Aug 21, 2025
81578a0
remove unneeded tests for this PR
pgherveou Aug 21, 2025
6000ed4
fixes
pgherveou Aug 21, 2025
c679776
keep these files for next PR
pgherveou Aug 21, 2025
5f839b6
comments
pgherveou Aug 21, 2025
8110392
fixes
pgherveou Aug 21, 2025
7a1c0a6
fix
pgherveou Aug 21, 2025
83ea8cd
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Aug 21, 2025
165957c
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 21, 2025
2b07ca6
rename seal_to_account_id
pgherveou Aug 21, 2025
f96fa39
update PRDOC
pgherveou Aug 21, 2025
2f369ad
Merge branch 'master' into pg/revm
pgherveou Aug 21, 2025
b66b47a
fix bench
pgherveou Aug 21, 2025
4d0db7e
output.data shoudl be untouched
pgherveou Aug 22, 2025
79b84da
install solidity in job
pgherveou Aug 22, 2025
4b80099
use resolc too
pgherveou Aug 22, 2025
4b6f4d2
rm line
pgherveou Aug 22, 2025
ab15dc1
enforce evm code size limit
pgherveou Aug 23, 2025
e93c1a0
fix
pgherveou Aug 25, 2025
04d0551
fix
pgherveou Aug 25, 2025
8f8ebcc
fix
pgherveou Aug 25, 2025
dec0849
PR review
pgherveou Aug 26, 2025
dbfc430
make pristine unbounded and check PVM & EVM code size
pgherveou Aug 26, 2025
87b7b4e
nit
pgherveou Aug 26, 2025
b769010
refcount = 1 for evm
pgherveou Aug 26, 2025
0abfc74
fix
pgherveou Aug 26, 2025
6060eb4
fix
pgherveou Aug 26, 2025
2007fb5
add one more assert
pgherveou Aug 26, 2025
f219e06
nit
pgherveou Aug 26, 2025
33e9216
Remove refcount and owner for EVM CodeInfo
pgherveou Aug 26, 2025
f75403a
rm unused
pgherveou Aug 26, 2025
d26d8ac
origin should be held not caller
pgherveou Aug 26, 2025
cc8cef4
Merge branch 'master' into pg/revm
pgherveou Aug 27, 2025
e405e18
rollback refcount removals
pgherveou Aug 27, 2025
8b1669f
Update Cargo.toml
pgherveou Aug 27, 2025
4f86e9b
Update prdoc/pr_9285.prdoc
pgherveou Aug 27, 2025
315ae52
Update substrate/frame/revive/src/call_builder.rs
pgherveou Aug 27, 2025
3598d6f
Update substrate/frame/revive/src/benchmarking.rs
pgherveou Aug 27, 2025
3272e99
rm charge_evm_init_cost
pgherveou Aug 27, 2025
e2242a2
fix
pgherveou Aug 27, 2025
7fa6421
rm - 1
pgherveou Aug 27, 2025
ae647b6
restore legacy behaviour
pgherveou Aug 27, 2025
1a073b6
update
pgherveou Aug 28, 2025
d4d8c1a
deadcode unused for now
pgherveou Aug 28, 2025
e286c49
deposit fixes
pgherveou Aug 28, 2025
f9aebdc
add missing assert
pgherveou Aug 28, 2025
7232f99
tweak tests
pgherveou Aug 28, 2025
f175c1b
ensure pallet_account exits
pgherveou Aug 28, 2025
bf19cf0
fixes
pgherveou Aug 29, 2025
7211711
nit
pgherveou Aug 29, 2025
c1ba77d
update comment
pgherveou Aug 29, 2025
46f6dfb
Add back remove_code
pgherveou Aug 29, 2025
546d65d
nit
pgherveou Aug 29, 2025
d820477
Update substrate/frame/revive/src/lib.rs
pgherveou Aug 29, 2025
c16e6ce
mint balance in migration
pgherveou Aug 29, 2025
1541263
rm check
pgherveou Aug 29, 2025
0a8935c
fmt
pgherveou Aug 29, 2025
692abb2
fixes
pgherveou Aug 29, 2025
a504987
reject hash == 0
pgherveou Aug 29, 2025
3a9f3d7
warm up pallet_account
pgherveou Aug 29, 2025
c245621
Update substrate/frame/revive/src/migrations/v2.rs
pgherveou Aug 29, 2025
88c6b23
Update ExtBuilder
pgherveou Aug 29, 2025
3201fb2
Merge branch 'master' into pg/revm
pgherveou Aug 29, 2025
400c912
Update .github/workflows/tests-misc.yml
pgherveou Aug 29, 2025
a1178f3
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Aug 29, 2025
d502f36
fix tests-misc
pgherveou Sep 1, 2025
28a1b65
fix
pgherveou Sep 1, 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
12 changes: 12 additions & 0 deletions .github/workflows/tests-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,17 @@ jobs:
components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
- name: Install protobuf
run: brew install protobuf
- name: install solc
run: brew install solidity
- name: Install resolc
run: |
VERSION="0.3.0"
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-universal-apple-darwin"
echo "Downloading resolc v$VERSION from $ASSET_URL"
curl -Lsf --show-error -o $HOME/.cargo/bin/resolc "$ASSET_URL"
chmod +x $HOME/.cargo/bin/resolc
xattr -c $HOME/.cargo/bin/resolc
resolc --version
- name: cargo info
run: |
echo "######## rustup show ########"
Expand Down Expand Up @@ -406,3 +417,4 @@ jobs:
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi

Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,10 @@ impl pallet_revive::Config for Runtime {
type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>;
type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>;
type UnsafeUnstableInterface = ConstBool<false>;
#[cfg(feature = "runtime-benchmarks")]
type AllowEVMBytecode = ConstBool<true>;
#[cfg(not(feature = "runtime-benchmarks"))]
type AllowEVMBytecode = ConstBool<false>;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type RuntimeHoldReason = RuntimeHoldReason;
Expand All @@ -1199,7 +1203,10 @@ parameter_types! {
impl pallet_migrations::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = pallet_revive::migrations::v1::Migration<Runtime>;
type Migrations = (
pallet_revive::migrations::v1::Migration<Runtime>,
pallet_revive::migrations::v2::Migration<Runtime>,
);
// Benchmarks need mocked migrations to guarantee that they succeed.
#[cfg(feature = "runtime-benchmarks")]
type Migrations = pallet_migrations::mock_helpers::MockedMigrations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1664,11 +1664,14 @@ fn weight_of_message_increases_when_dealing_with_erc20s() {
fn withdraw_and_deposit_erc20s() {
let sender: AccountId = ALICE.into();
let beneficiary: AccountId = BOB.into();
let revive_account = pallet_revive::Pallet::<Runtime>::account_id();
let checking_account =
asset_hub_westend_runtime::xcm_config::ERC20TransfersCheckingAccount::get();
let initial_wnd_amount = 10_000_000_000_000u128;

ExtBuilder::<Runtime>::default().build().execute_with(|| {
// Bring the revive account to life.
assert_ok!(Balances::mint_into(&revive_account, initial_wnd_amount));
// We need to give enough funds for every account involved so they
// can call `Revive::map_account`.
assert_ok!(Balances::mint_into(&sender, initial_wnd_amount));
Expand Down Expand Up @@ -1729,13 +1732,16 @@ fn withdraw_and_deposit_erc20s() {
fn non_existent_erc20_will_error() {
let sender: AccountId = ALICE.into();
let beneficiary: AccountId = BOB.into();
let revive_account = pallet_revive::Pallet::<Runtime>::account_id();
let checking_account =
asset_hub_westend_runtime::xcm_config::ERC20TransfersCheckingAccount::get();
let initial_wnd_amount = 10_000_000_000_000u128;
// We try to withdraw an ERC20 token but the address doesn't exist.
let non_existent_contract_address = [1u8; 20];

ExtBuilder::<Runtime>::default().build().execute_with(|| {
// Bring the revive account to life.
assert_ok!(Balances::mint_into(&revive_account, initial_wnd_amount));
// We need to give enough funds for every account involved so they
// can call `Revive::map_account`.
assert_ok!(Balances::mint_into(&sender, initial_wnd_amount));
Expand Down Expand Up @@ -1772,11 +1778,15 @@ fn non_existent_erc20_will_error() {
fn smart_contract_not_erc20_will_error() {
let sender: AccountId = ALICE.into();
let beneficiary: AccountId = BOB.into();
let revive_account = pallet_revive::Pallet::<Runtime>::account_id();
let checking_account =
asset_hub_westend_runtime::xcm_config::ERC20TransfersCheckingAccount::get();
let initial_wnd_amount = 10_000_000_000_000u128;

ExtBuilder::<Runtime>::default().build().execute_with(|| {
// Bring the revive account to life.
assert_ok!(Balances::mint_into(&revive_account, initial_wnd_amount));

// We need to give enough funds for every account involved so they
// can call `Revive::map_account`.
assert_ok!(Balances::mint_into(&sender, initial_wnd_amount));
Expand Down Expand Up @@ -1822,11 +1832,15 @@ fn smart_contract_not_erc20_will_error() {
fn smart_contract_does_not_return_bool_fails() {
let sender: AccountId = ALICE.into();
let beneficiary: AccountId = BOB.into();
let revive_account = pallet_revive::Pallet::<Runtime>::account_id();
let checking_account =
asset_hub_westend_runtime::xcm_config::ERC20TransfersCheckingAccount::get();
let initial_wnd_amount = 10_000_000_000_000u128;

ExtBuilder::<Runtime>::default().build().execute_with(|| {
// Bring the revive account to life.
assert_ok!(Balances::mint_into(&revive_account, initial_wnd_amount));

// We need to give enough funds for every account involved so they
// can call `Revive::map_account`.
assert_ok!(Balances::mint_into(&sender, initial_wnd_amount));
Expand Down Expand Up @@ -1875,11 +1889,15 @@ fn smart_contract_does_not_return_bool_fails() {
fn expensive_erc20_runs_out_of_gas() {
let sender: AccountId = ALICE.into();
let beneficiary: AccountId = BOB.into();
let revive_account = pallet_revive::Pallet::<Runtime>::account_id();
let checking_account =
asset_hub_westend_runtime::xcm_config::ERC20TransfersCheckingAccount::get();
let initial_wnd_amount = 10_000_000_000_000u128;

ExtBuilder::<Runtime>::default().build().execute_with(|| {
// Bring the revive account to life.
assert_ok!(Balances::mint_into(&revive_account, initial_wnd_amount));

// We need to give enough funds for every account involved so they
// can call `Revive::map_account`.
assert_ok!(Balances::mint_into(&sender, initial_wnd_amount));
Expand Down
1 change: 1 addition & 0 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ impl pallet_revive::Config for Runtime {
type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>;
type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>;
type UnsafeUnstableInterface = ConstBool<true>;
type AllowEVMBytecode = ConstBool<true>;
type UploadOrigin = EnsureSigned<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down
17 changes: 17 additions & 0 deletions prdoc/pr_9285.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: '[revive] revm backend'
doc:
- audience: Runtime Dev
description: |
Initial EVM support for pallet-revive via the REVM crate to create a dual-VM system that can execute both PolkaVM and EVM
- Added AllowEVMBytecode: Get<bool> to the config to enable/disable EVM call and instantiation
- The basic flow of uploading an EVM contract and running it should work
- instructions are copied and adapted from REVM they should be ignored in this PR and reviewed in follow-up PR
crates:
- name: pallet-revive
bump: major
- name: pallet-revive-fixtures
bump: patch
- name: asset-hub-westend-runtime
bump: patch
- name: penpal-runtime
bump: patch
1 change: 1 addition & 0 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ impl pallet_revive::Config for Runtime {
type NativeToEthRatio = ConstU32<1_000_000>; // 10^(18 - 12) Eth is 10^18, Native is 10^12.
type EthGasEncoder = ();
type FindAuthor = <Runtime as pallet_authorship::Config>::FindAuthor;
type AllowEVMBytecode = ConstBool<true>;
}

impl pallet_sudo::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/fixtures/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ fn generate_fixture_location(temp_dir: &Path, out_dir: &Path, entries: &[Entry])
// Generate sol! macros for Solidity contracts
for entry in entries.iter().filter(|e| matches!(e.contract_type, ContractType::Solidity)) {
let relative_path = format!("contracts/{}", entry.path().split('/').last().unwrap());
writeln!(file, r#"alloy_core::sol!("{}");"#, relative_path)
writeln!(file, r#"#[cfg(feature = "std")] alloy_core::sol!("{}");"#, relative_path)
.context("Failed to write sol! macro to fixture_location.rs")?;
}

Expand Down
11 changes: 11 additions & 0 deletions substrate/frame/revive/fixtures/contracts/Fibonacci.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Fibonacci {
function fib(uint n) public pure returns (uint) {
if (n <= 1) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
}
Loading
Loading