Skip to content

Commit

Permalink
Explain different solc options (Uniswap#429)
Browse files Browse the repository at this point in the history
* explain solc options

* Add reference in readme

* random linting issue
  • Loading branch information
hensha256 authored and hyunchel committed Feb 21, 2024
1 parent 558f3cb commit af8b1c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,21 @@ All contributions must follow the below standards. Maintainers will close out PR

## Setup

Run `source .env` to set FOUNDRY_SOLC to the correct solc binary.
For V4, an unreleased solc binary is used to add support for TLOAD and TSTORE. There are options for using this binary with forge:

`forge build` to get contract artifacts and dependencies for forge
### Using `just`

If after running `source .env`, you continue to get the error `Function "tload" not found.` try running
`just build` to get contract artifacts and dependencies for forge

On MacOS:
`forge build --use ./bin/solc-mac`
`just test` to run forge tests and update snapshots

On Linux:
`forge build --use ./bin/solc-static-linux`
### Using environment variables

## Tests
Run `source .env` to set `FOUNDRY_FUZZ_SEED` and `FOUNDRY_SOLC` environment variables. You can then use forge directly

`forge snapshot` to update the forge gas snapshots. Note these must use a static fuzz seed, so please run `source .env`, use `FOUNDRY_FUZZ_SEED=0x4444`, or use `just snapshots` when running forge snapshots.
`forge build` to get contract artifacts and dependencies for forge

`forge test` to run forge tests
`forge test` to run forge tests and update snapshots

## Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The contracts in this repo are in early stages - we are releasing the draft code

## Contributing

If you’re interested in contributing please see our [contribution guidelines](./CONTRIBUTING.md)!
If you’re interested in contributing please see our [contribution guidelines](./CONTRIBUTING.md)! This includes instructions on how to compile using `TSTORE` and `TLOAD` opcodes in the `Setup` section.

## Whitepaper

Expand Down
2 changes: 1 addition & 1 deletion test/PoolManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot {
}

function test_take_failsWithInvalidTokensThatDoNotReturnTrueOnTransfer() public {
TestInvalidERC20 invalidToken = new TestInvalidERC20(2**255);
TestInvalidERC20 invalidToken = new TestInvalidERC20(2 ** 255);
Currency invalidCurrency = Currency.wrap(address(invalidToken));
invalidToken.approve(address(modifyPositionRouter), type(uint256).max);
invalidToken.approve(address(takeRouter), type(uint256).max);
Expand Down

0 comments on commit af8b1c1

Please sign in to comment.