Skip to content

Instantly share code, notes, and snippets.

View muellerberndt's full-sized avatar

Bernhard Mueller muellerberndt

View GitHub Profile
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;
abstract contract IModuleAuth {
/**
* @notice Hashed _data to be signed
* @param _data Data to be hashed
* @return hashed data for this wallet
*/
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;
contract MythXVerification {
event AssertionFailed(string message);
modifier checkInvariants {
_;
[
{
"issues": [
{
"swcID": "SWC-104",
"swcTitle": "Unchecked Call Return Value",
"description": {
"head": "Unchecked return value from external call.",
"tail": "External calls return a boolean value. If the callee halts with an exception, 'false' is returned and execution continues in the caller. The caller should check whether an exception happened and react accordingly to avoid unexpected behavior. For example it is often desirable to wrap external calls in require() so the transaction is reverted if the call fails."
pragma solidity >0.4.99 <0.6.0;
/** @title Utility to expand strings' functionality.
* @author Mohd Shahnawaz
*/
library LibraryDemo {
uint constant private ALLOCATION_FOR_STRING = 32;
/** @dev Get size of allocation of given string variable.
//sol Wallet
// A simplified version of the famous multi-sig, daily-limited account proxy/wallet.
// @authors:
// Gav Wood <[email protected]>
// Adapted by B. Mueller
// inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a
// single, or, crucially, each of a number of, designated owners.
// usage:
// use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by
pragma solidity ^0.5.0;
contract Vulnerable2Calls {
address public owner;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
pragma solidity ^0.5.0;
contract FunWithNumbers {
uint constant public tokensPerEth = 10;
uint constant public weiPerEth = 1e18;
mapping(address => uint) public balances;
function buyTokens() public payable {
uint tokens = msg.value/weiPerEth*tokensPerEth; // convert wei to eth, then multiply by token rate
balances[msg.sender] += tokens;
pragma solidity ^0.5.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
pragma solidity ^0.5.0;
import "./SafeMath.sol";
// A liquidity pool that also does collateralized loans!!
contract zBx {
using SafeMath for uint256;
pragma solidity ^0.4.25;
// Name Registrar
contract NameRegistry {
address public owner;
bool public lock;
struct NameRecord { // map hashes to addresses
bytes32 name; //