Skip to content

Instantly share code, notes, and snippets.

View 0xA5DF's full-sized avatar

0xA5DF

View GitHub Profile
@0xA5DF
0xA5DF / !README.md
Last active February 23, 2024 12:20
Estimate C4 payout

Alternatives

I noticed there's a better alternative here

About

This is a script that can be used to estimate your rewards form HMs submissions on C4. In order to use it fill out in the .env file:

  • HMS_POT - the HM awards for the contest
  • CONTEST_NAME - can be also partial name, but best to use the full name to avoid dupes (e.g. 2024-01-renft)
  • GH_ACCESS_TOKEN - it has to be a classic token with the repo scope permissions, not a fine-grained token. The fine-grained tokens don't support reading private repos that you don't own.
@0xA5DF
0xA5DF / !README.md
Last active August 19, 2022 13:37
Forge calculates gas as if it's all one tx (affecting ops that depend on warm/cold keys/addresses)

Forge calculates gas as if each test is one tx

Sample code

When runing forge test -m testGas --gas-report -vv, it shows the cost of calling x is 261:

╭──────────────────────────────────┬─────────────────┬─────┬────────┬─────┬─────────╮
│ contracts/Gas.sol:Store contract ┆                 ┆     ┆        ┆     ┆         │
╞══════════════════════════════════╪═════════════════╪═════╪════════╪═════╪═════════╡
│ Deployment Cost                  ┆ Deployment Size ┆     ┆        ┆     ┆         │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤