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 e366bd2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
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_ALCHEMY_API}"
gnosis = "${GNOSIS_ALCHEMY_API}"
polygon = "${POLYGON_ALCHEMY_API}"

# 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);
}
}
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 e366bd2

Please sign in to comment.