Skip to content

Commit

Permalink
UniswapOnlyGuard.sol: mapping for allowed addreses #5
Browse files Browse the repository at this point in the history
  • Loading branch information
utgarda committed Oct 18, 2023
1 parent 6c5eeba commit 81030f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ Our ETHOnline2023 focus: integration with Uniswap and harnessing Safe smart wall

Monorepo setup: smart contracts in root, frontend in its folder. We integrate Foundry/Forge with GitHub Actions for streamlined CI/CD.

### Clone/Checkout
Clone with submodules
```shell
git clone --recurse-submodules [email protected]:chainhackers/ethonline-2023.git
```
Update submodules when you need to
```shell
git submodule update --init --recursive
```

## Test in Polygon Mainnet fork
```shell
source .env
Expand Down
12 changes: 8 additions & 4 deletions src/UniswapOnlyGuard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ import "./Constants.sol";

contract UniswapOnlyGuard is Guard {
address public immutable permit2;
IERC20[] public allowedTokens;
IERC20 usdc = IERC20(USDC_POLYGON);
mapping(address => bool) allowedTokens;

constructor(address permit2_, IERC20[] memory allowedTokens_){
constructor(
address permit2_,
IERC20[] memory allowedTokens_
){
permit2 = permit2_;
allowedTokens = allowedTokens_;
for(int i = 0; i < allowedTokens_.length; i++){
allowedTokens[allowedTokens_[i]] = true;
}
}

// TODO not sure, experimenting, consider removing this
Expand Down

0 comments on commit 81030f3

Please sign in to comment.