Smart Contracts
A few small bits about attacking Smart Contracts in Web3
Compiling .sol to .abi
$ npx solc --abi <NAME>.sol -o <DIRECTORY>
# # For example
$ npx solc --abi Setup.sol -o .Setup.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.7.3+commit.9bfce1f6.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version- pragma solidity ^0.8.18;
+ pragma solidity ^0.7.3;Simple Interaction
pragma solidity ^0.8.18;
contract Example {
bool public updated;
function call_me(uint256 number) external {
if (number == 42) {
updated = true;
}
}
}Manual Transactions
The fallback() method
fallback() methodThe receive() method
receive() methodRequirements
Last updated