Weird revert with forge test #2417
Answered
by
onbjerg
CaledoniaProject
asked this question in
Help
-
I have a simple contract that emits logs on transfer: King.sol
And the test contract, aka King.t.sol
When I run forge test -vvv:
And it failed while accessing |
Beta Was this translation helpful? Give feedback.
Answered by
onbjerg
Jul 21, 2022
Replies: 1 comment
-
When you use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
CaledoniaProject
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you use
address.transfer
, the gas limit is set to 2300 gas (this is not because of Forge, this is just how it works). Emitting those logs cost 750 gas each for theLOG0
opcode alone, but there is additional opcodes involved as well (parsing the calldata, jumping, checkingmsg.value
, pushing the strings etc.) so most likely you are running out of gas.