Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a XEN spam scenario. Note that state impact of XEN comes from deploying contracts, not claiming XEN tokens, so this spam scenario only focuses on deploying tokens.
Motivation
XEN spam has caused concerns for state growth on major L2s like Base. This script helps measure the state growth cased by XEN spam. #140
Testing
On terminal 1, run:
anvil
On terminal 2, run:
PRV_KEY
.contender setup ./scenarios/xen.toml http://127.0.0.1:8545 --min-balance 1
contender spam ./scenarios/xen.toml http://127.0.0.1:8545 --tps 1 -d 1 -p $PRV_KEY --min-balance 0.01
How I generated my XENCrypto bytecode
I generated the
XENCrypto
bytecode using the latest master release from https://github.com/FairCrypto/XEN-crypto, and used the "adding foundry to a hardhat project" so I could add foundry to its repo & run the commandforge build
,cat out/XENCrypto.sol/XENCrypto.json | jq .bytecode.object
, andcat out/XENMath.sol/XENMath.json | jq .bytecode.object
.Note that since the
hardhat.config
is in typescript, useimport "@nomicfoundation/hardhat-foundry";
instead ofrequire("@nomicfoundation/hardhat-foundry");
in the hardhat to foundry guide.In the bytecode or XENCrypto, I replaced all instances of
__$e50d57b7f0af7faa838eeefa2a76c9e08d$__
(this is the only weird text that shows up) with{XENMath}
, because that was the only other solidity file in the repoIssue
So far, my
XENTorrent
bytecode has an issue where runningcontender spam ./scenarios/xen.toml http://127.0.0.1:8545 --tps 1 -d 1 -p $PRV_KEY --min-balance 0.01
produces an error of:I generated my
XENTorrent
bytecode by taking the latest master commit of the XENFT repo, converting the repo from Truffle into Hardhat via this guide, and then converting from hardhat to foundry via the guide I used for XENCrypto's bytecode.Lastly, I ran
forge build --optimizer-runs 2000
andcat out/XENFT.sol/XENTorrent.json | jq .bytecode.object
Without
--optimizer-runs 2000
, your bytecode will be too long and you will have the following error:I then appended the constructor arguments bytecode of:
000000000000000000000000{XENCrypto}{burnRates_}{tokenLimits_}{startBlockNumber_}{forwarder_}{royalty_Receiver_}00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cecb8f27f4200f3a0000000000000000000000000000000000000000000000019d971e4fe8401e740000000000000000000000000000000000000000000000033b2e3c9fd0803ce800000000000000000000000000000000000000000000000813f3978f8940984400000000000000000000000000000000000000000000001027e72f1f128130880000000000000000000000000000000000000000000000204fce5e3e25026110000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000017700000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000064
since that was the constructor arguments used in the contract deployment tx on base: https://basescan.org/token/0x379002701bf6f2862e3dfdd1f96d3c5e1bf450b6#code
In our original build bytecode, there were two instances of
__${insert data here}$__
, so in one trial I replaced one with {XENMath} and {XENCrypto}, and in another trial I did the other order. Neither worked at the end as I had the same error message when runningspam
.I then tried creating a
forge test
file for theXENTorrent.sol
file with the arguments above, and those worked.So unsure if the constructor arguments section of the bytecode is an issue. But my bytecode definitely has an issue.