Skip to content

Instantly share code, notes, and snippets.

View muellerberndt's full-sized avatar

Bernhard Mueller muellerberndt

View GitHub Profile
0xbb60edde73b73c13a847c4ce1fe3ab388cb27c44
0x2654d4de40a5119c7dc1799ed14b17d264fa1d8e
#!/usr/bin/env python
from mythril.ether.util import compile_solidity
from mythril.ether.ethcontract import ETHContract
from mythril.analysis.symbolic import StateSpace
from mythril.analysis import solver
from mythril.exceptions import UnsatError
from z3 import *
pragma solidity ^0.4.18;
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
pragma solidity ^0.4.18;
contract Pwnable {
address public owner;
address[] a1;
function Pwnable() public {
owner = msg.sender;
a1.length -= 1;
pragma solidity ^0.4.17;
contract Callee {
function theFunction(uint value) public returns(bool retval) {
if (value == 1){
return true;
} else {
return false;
contract Partner {
function exchangeTokensFromOtherContract(address _source, address _recipient, uint256 _RequestedTokens);
}
contract Target {
function transfer(address _to, uint _value);
}
contract COE {
pragma solidity ^0.4.23;
contract Hot {
event CreateEvent(uint id, uint bid, string name, string link);
event SupportEvent(uint id, uint bid);
struct Record {
uint index;
uint bid;
@muellerberndt
muellerberndt / gist:0764905d698200d76f7d454ea42ed79f
Last active January 9, 2019 03:30
Clear a go-ethereum wallet
gasPrice = web3.toWei(1.5, "gwei");
eth.sendTransaction({from: sender, to: receiver, gas: 21000, gasPrice: gasPrice, value: eth.getBalance(sender) - (gasPrice * 21000)})
$ $MYTH -t1 -m constantinople_bug_1,constantinople_bug_2 -x PaymentSharer.sol
==== State write for 1600 gas or less ====
SWC ID: 107
Severity: Medium
Contract: PaymentSharer
Function name: deposit(uint256)
PC address: 330
Estimated Gas Usage: 947 - 26032
Caller can modify state for 1600 gas or less.
The planned Constantinople hard fork reduces the gas cost for writing to state variables that have been written to in the same transaction. In some cases this may cause re-rentrancy vulnerabilities in previously safe contracts.