Closed tamermint closed 5 months ago
Also - I tried deploying on Sepolia - it failed because of high gas as well (I don't have 0.6 SepEth) :
make deployEvolution ARGS="--network sepolia"
[⠒] Compiling...
No files changed, compilation skipped
Traces:
[50158302] DeployEvolutionNft::run()
├─ [0] VM::envUint("PRIVATE_KEY") [staticcall]
│ └─ ← [Return] <env var value>
├─ [0] VM::readFile("./img/porcuparus.svg") [staticcall]
│ └─ ← [Return] <file>
├─ [0] VM::readFile("./img/charosaurus.svg") [staticcall]
│ └─ ← [Return] <file>
├─ [0] VM::startBroadcast(<pk>)
│ └─ ← [Return]
├─ [45700028] → new EvolutionNft@0x1b1e8E7c8eb31acEEA360C064C65aa4D8CA27847
│ └─ ← [Return] 5143 bytes of code
├─ [0] VM::stopBroadcast()
│ └─ ← [Return]
└─ ← [Return] EvolutionNft: [0x1b1e8E7c8eb31acEEA360C064C65aa4D8CA27847]
Script ran successfully.
== Return ==
0: contract EvolutionNft 0x1b1e8E7c8eb31acEEA360C064C65aa4D8CA27847
## Setting up 1 EVM.
==========================
Simulated On-chain Traces:
[45700028] → new EvolutionNft@0x1b1e8E7c8eb31acEEA360C064C65aa4D8CA27847
└─ ← [Return] 5143 bytes of code
==========================
Chain 11155111
Estimated gas price: 11.05889522 gwei
Estimated total gas used for script: 60931837
Estimated amount required: 0.67383880094511914 ETH
==========================
##
Sending transactions [0 - 0].
Transactions saved to: /Users/vivekmitra/Desktop/Learn2Code/web3code/Foundry/foundry-nfts-f24/broadcast/DeployEvolutionNft.s.sol/11155111/run-latest.json
Sensitive values saved to: /Users/vivekmitra/Desktop/Learn2Code/web3code/Foundry/foundry-nfts-f24/cache/DeployEvolutionNft.s.sol/11155111/run-latest.json
Error:
Failed to send transaction
Context:
- server returned an error response: error code -32000: max initcode size exceeded: code size 70085, limit 49152
make: *** [deployEvolution] Error 1
Your SVGs are too big to fit into one contract :)
You'll have to get creative if you want to keep them as SVGs! Otherwise, you can have them point to IPFS or something else.
Thanks @PatrickAlphaC - so all I need to do is change this :
string memory porcuSvg = vm.readFile("./img/porcuparus.svg");
string memory charoSvg = vm.readFile("./img/charosaurus.svg");
to
string memory porcuSvg = ipfs://...
string memory charoSvg = ipfs://...
?
That should work! Since an IPFS link will be much smaller.
Hi all,
I am trying to deploy the MoodNft named as evolutionNft.sol - I made a tweak - I am using a different SVG image - but the logic is the same. However, when I am deploying it on anvil I get this error :
I am using freshly imported anvil account in metamask and I cleared the nonce and activity through metamask but I still am facing the issue.
I did move ahead and used cast on the contract address returned above :
But in metamask, it doesn't let me import token and it tells me I am not the owner :
My deploy script :
Can anyone please advice? Thanks in advance :)