Skip to content

Commit f34b4a3

Browse files
committed
fix to pass ci
1 parent e324260 commit f34b4a3

File tree

12 files changed

+13
-18
lines changed

12 files changed

+13
-18
lines changed

.env

-3
This file was deleted.

.env.template

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RPC_MAINNET=https://rpc.ankr.com/eth

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
env:
1414
FOUNDRY_PROFILE: ci
15+
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
1516

1617
jobs:
1718
check:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ storage
3737
*.gz
3838

3939
attachments/
40+
41+
.env

foundry.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ ignored_error_codes = [
1313
9302, # Warning (9302): Return value of low-level calls not used.
1414
]
1515

16-
# For Huff & Vyper
16+
# For Huff
1717
ffi = true
1818
fs_permissions = [{ access = "read", path = "./out" }]
1919

2020
# For CREATE2
2121
bytecode_hash = "none"
2222
cbor_metadata = false
2323

24-
[profile.default.rpc_endpoints]
25-
mainnet = "https://rpc.ankr.com/eth"
26-
2724
# See more config options https://github.com/foundry-rs/foundry/tree/master/crates/config

src/Ethernaut/CoinFlip/CoinFlipExploit.t.sol

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity ^0.8.13;
44
import {Test, console2} from "forge-std/Test.sol";
55
import {playerScript, CoinFlipExploit} from "./CoinFlipExploit.sol";
66
import {CoinFlipFactory} from "./CoinFlipFactory.sol";
7-
import {VyperUtils} from "src/utils/VyperUtils.sol";
87

98
contract CoinFlipExploitTest is Test {
109
address playerAddr = makeAddr("player");
@@ -30,9 +29,7 @@ contract CoinFlipExploitTest is Test {
3029
}
3130

3231
function testExploitVyper() public solveChecker {
33-
VyperUtils vyperUtils = new VyperUtils();
34-
vm.allowCheatcodes(address(vyperUtils));
35-
address exploitAddr = vyperUtils.deploy("src/Ethernaut/CoinFlip/CoinFlipExploit.vy");
32+
address exploitAddr = deployCode("src/Ethernaut/CoinFlip/CoinFlipExploit.vy");
3633
for (uint256 i = 0; i < 10; i++) {
3734
vm.roll(i + 10);
3835
(bool success,) = exploitAddr.call(abi.encodeWithSignature("exploit(address)", instanceAddr));

src/Ethernaut/CoinFlip/CoinFlipExploit.vy

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ interface ICoinFlip:
77
def exploit(instanceAddress: address):
88
instance: ICoinFlip = ICoinFlip(instanceAddress)
99
blockValue: uint256 = convert(blockhash(block.number - 1), uint256)
10-
coinFlip: uint256 = blockValue / FACTOR
10+
coinFlip: uint256 = blockValue // FACTOR
1111
side: bool = coinFlip == 1
12-
instance.flip(side)
12+
extcall instance.flip(side)

src/HuffChallenge/challenge5/Challenge5.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ contract Challenge5Test is Test {
1010

1111
function setUp() public {
1212
// Fork mainnet
13-
vm.createSelectFork(vm.envString("RPC_ANKR_MAINNET"));
13+
vm.createSelectFork(vm.envString("RPC_MAINNET"));
1414
solver = HuffDeployer.config().deploy("HuffChallenge/challenge5/Challenge5");
1515
}
1616

src/ParadigmCTF2021/Farmer/FarmerExploit.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ contract FarmerExploitTest is Test {
88
address playerAddress = makeAddr("player");
99

1010
function setUp() public {
11-
vm.createSelectFork(vm.envString("RPC_ANKR_MAINNET"));
11+
vm.createSelectFork(vm.envString("RPC_MAINNET"));
1212
vm.deal(playerAddress, 10 ether);
1313
}
1414

src/ParadigmCTF2021/Secure/SecureExploit.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ contract SecureExploitTest is Test {
88
address playerAddress = makeAddr("player");
99

1010
function setUp() public {
11-
vm.createSelectFork(vm.envString("RPC_ANKR_MAINNET"));
11+
vm.createSelectFork(vm.envString("RPC_MAINNET"));
1212
vm.deal(playerAddress, 50 ether);
1313
}
1414

src/ParadigmCTF2023/GrainsOfSand/Exploit.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract ExploitTest is Test {
1313
IToken token;
1414

1515
function setUp() public {
16-
vm.createSelectFork("mainnet", 18437825);
16+
vm.createSelectFork(vm.envString("RPC_MAINNET"), 18437825);
1717
vm.deal(playerAddr, 1000 ether);
1818
challenge = new Challenge();
1919
tokenStore = ITokenStore(0x1cE7AE555139c5EF5A57CC8d814a867ee6Ee33D8);

src/ParadigmCTF2023/SkillBasedGame/Exploit.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ contract ExploitTest is Test {
1111
Challenge challenge;
1212

1313
function setUp() public {
14-
vm.createSelectFork("mainnet");
14+
vm.createSelectFork(vm.envString("RPC_MAINNET"));
1515
vm.deal(playerAddr, 1000 ether);
1616

1717
payable(BLACKJACK).transfer(50 ether);

0 commit comments

Comments
 (0)