Skip to content

Commit

Permalink
Changed rpc endpoints to env vars. Moved ankr rpc definitions to temp…
Browse files Browse the repository at this point in the history
…late branches
  • Loading branch information
alejandro-immunefi committed Jan 9, 2024
1 parent e00ada9 commit b130488
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:

env:
FOUNDRY_PROFILE: ci
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }}
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }}

jobs:
lint:
Expand Down
6 changes: 4 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ out = 'out'
libs = ['lib']

# Ankr RPC endpoints (https://www.ankr.com/rpc/)
rpc_endpoints = { eth = "https://rpc.ankr.com/eth", optimism = "https://rpc.ankr.com/optimism", fantom = "https://rpc.ankr.com/fantom", arbitrum = "https://rpc.ankr.com/arbitrum", bsc = "https://rpc.ankr.com/bsc", moonriver = "https://moonriver.public.blastapi.io", gnosis = "https://rpc.ankr.com/gnosis", Avalanche = "https://rpc.ankr.com/avalanche", polygon = "https://rpc.ankr.com/polygon", celo = "https://rpc.ankr.com/celo", solana = "https://rpc.ankr.com/solana", IoTeX = "https://rpc.ankr.com/iotex", harmony = "https://rpc.ankr.com/harmony", aptos = "https://rpc.ankr.com/http/aptos/v1", tron = "https://rpc.ankr.com/http/tron", near = "https://rpc.ankr.com/near", klaytn = "https://rpc.ankr.com/klaytn", filecoin = "https://rpc.ankr.com/filecoin", nervos = "https://rpc.ankr.com/nervos", bttc = "https://rpc.ankr.com/bttc", syscoin = "https://rpc.ankr.com/syscoin", arbitrumnova = "https://rpc.ankr.com/arbitrumnova", secretnetwork = "https://rpc.ankr.com/scrt" }

[rpc_endpoints]
eth = "${ETH_RPC_URL}"
gnosis = "${GNOSIS_RPC_URL}"
polygon = "${POLYGON_RPC_URL}"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion src/tokens/examples/TokenExampleManipulation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "../Tokens.sol";

contract TokenExampleManipulation is Tokens {
function manipulateTokenBalance() external {
deal(EthereumTokens.USDC, address(this), 1 ether);
deal(EthereumTokens.WETH, address(this), 1 ether);
}
}
5 changes: 0 additions & 5 deletions test/examples/LogExample.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ import "forge-std/Test.sol";
import "../../src/log/examples/LogExample.sol";

contract LogExampleTest is Test {
uint256 mainnetFork;

LogExample public logExample;

function setUp() public {
mainnetFork = vm.createFork("eth");
vm.selectFork(mainnetFork);

logExample = new LogExample();
}

Expand Down
2 changes: 1 addition & 1 deletion test/examples/PriceManipulationExample.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract PriceManipulationExampleTest is Test {
PriceManipulationExample public attackContract;

function setUp() public {
mainnetFork = vm.createFork("eth");
mainnetFork = vm.createFork("eth", 18464488);
vm.selectFork(mainnetFork);

attackContract = new PriceManipulationExample();
Expand Down
4 changes: 2 additions & 2 deletions test/examples/TokensExample.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ contract TokensExampleTest is Test {
}

function testTokenManipulation() public {
console.log("Balance before:", EthereumTokens.USDC.balanceOf(address(tokenExample)));
console.log("Balance before:", EthereumTokens.WETH.balanceOf(address(tokenExample)));
tokenExample.manipulateTokenBalance();
console.log("Balance after:", EthereumTokens.USDC.balanceOf(address(tokenExample)));
console.log("Balance after:", EthereumTokens.WETH.balanceOf(address(tokenExample)));
}
}
2 changes: 1 addition & 1 deletion test/pocs/DFXFinanceBugfixReview.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ contract DFXFinanceBugfixReviewTest is PoC {
IERC20 EURS = IERC20(0xE111178A87A3BFf0c8d18DECBa5798827539Ae99);

function setUp() public {
vm.createSelectFork("https://rpc.ankr.com/polygon", 42064500);
vm.createSelectFork("polygon", 42064500);

attackContract = new DFXFinanceBugfixReview();
tokens.push(PolygonTokens.USDC);
Expand Down

0 comments on commit b130488

Please sign in to comment.