Skip to content

Instantly share code, notes, and snippets.

@cassc
cassc / trace_transaction_response.json
Created May 10, 2024 03:08
trace_transaction response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"callType": "call",
"from": "0x6438b5009a81b85800511f12a3d15f61fb553f53",
"gas": "0x12f44",
"input": "0xa9059cbb0000000000000000000000007154980e9be95eab4eef2269650d4c7e17f156b80000000000000000000000000000000000000000000000000000000033721c51",
@cassc
cassc / standard-input.json
Created April 29, 2024 07:37
sample standard json input with only one input
{
"language": "Solidity",
"settings": {
"optimizer": {
"enabled": false
},
"outputSelection": {
"*": {
"": [
"ast"
@cassc
cassc / MyTestContract.sol
Created April 29, 2024 05:42
reentrancy bug test
// SPDX-License-Identifier: MIT
pragma solidity >0.8.0;
contract MyTestContract {
mapping(address => uint) public balances;
address public owner ;
constructor() payable {
owner = msg.sender;
balances[msg.sender] = msg.value;
@cassc
cassc / AlienCodexTest.sol
Created April 11, 2024 09:46
AlienCodexTest
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
interface AlienCodex{
function owner() external view returns (address);
function makeContact() external;
function retract() external;
function revise(uint i, bytes32 _content) external;
}
@cassc
cassc / MagicNumTest.sol
Created April 11, 2024 09:38
MagicNumTest
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
contract Minimum{
address public addr;
constructor(){
// init code
// prepare CODECOPY
// PUSH1 0x0a // size of code, 10 bytes
@cassc
cassc / Preservation.t.sol
Created April 11, 2024 08:59
Preservation Attacker
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
contract Preservation {
// public library contracts
address public timeZone1Library;
address public timeZone2Library;
address public owner;
@cassc
cassc / NaughtCoinTest.sol
Created April 11, 2024 08:55
NaughtCoinTest
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
interface NaughtCoin{
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
@cassc
cassc / GatekeeperTwoAttacker.sol
Created April 11, 2024 08:47
GatekeeperTwo attacker
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
contract GatekeeperTwo {
address public entrant;
modifier gateOne() {
require(msg.sender != tx.origin);
@cassc
cassc / GatekeeperOneAttacker.sol
Created April 11, 2024 08:42
GatekeeperOneAttacker.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
contract GatekeeperOne {
address public entrant;
modifier gateOne() {
require(msg.sender != tx.origin);
@cassc
cassc / rekt.news.bugs.md
Created October 6, 2023 04:14
rekt.news bugs summary by chatgpt3.5

11-rekt

  • Contract names: Eleven.finance, Nerve Finance, NRV vault, Eleven "MasterMind" farming contract
  • Contract hex addresses: Not mentioned in the article
  • Bug types mentioned in the article:
    1. Vulnerable function (emergencyBurn()) in the intermediate vault contract
    2. Flashloan exploit
    3. Logic issue
    4. Unauthorized withdrawal