Skip to content

Instantly share code, notes, and snippets.

pragma solidity ^0.5.0;
import "truffle/Assert.sol";
import "../contracts/MyContract.sol";
contract MyContractWrapper is MyContract{
function callStoreNum(uint num) public{
storeNum(num);
}
}
@rmlopes
rmlopes / MyContract.sol
Last active January 4, 2019 10:20
Simple storage function for Solidity v0.5, with modifier
pragma solidity ^0.5.0;
contract MyContract {
uint public mynumber;
/* Modified simple storage function. Only stores numbers greater than 10. */
modifier checkValue(uint mynum){
require(mynum > 10);
_;
@rmlopes
rmlopes / TestSupplyChain.sol
Created December 28, 2018 21:43
Solidity ThrowProxy
pragma solidity ^0.5.0;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/SupplyChain.sol";
contract TestSupplyChain {
uint public initialBalance = 1 ether;
SupplyChain sc;
/*
This exercise has been updated to use Solidity version 0.5
Breaking changes from 0.4 to 0.5 can be found here:
https://solidity.readthedocs.io/en/v0.5.0/050-breaking-changes.html
*/
pragma solidity ^0.5.0;
contract SupplyChain {
pragma solidity ^0.5.0;
contract MultiSignatureWallet {
event Submission(uint indexed transactionId);
event Confirmation(address indexed sender, uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
address[] public owners;
@rmlopes
rmlopes / pyeve_abort_500.py
Last active June 28, 2018 09:55
An example of using flask abort to raise internal server errors with pyEve
# In case of an internal server error, flask abort will send an html reponse, which is not in line with a REST API.
# _handle_internal_error returns the typical pyEve json error response:
def _handle_internal_error(message, code=500):
abort(make_response(
jsonify(_status = "ERR",
_error = {'code':code, 'message':message}),
code))
[591880.526288] htop invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[591880.526293] htop cpuset=/ mems_allowed=0
[591880.526298] CPU: 2 PID: 17232 Comm: htop Not tainted 3.16.0-4-amd64 #1 Debian 3.16.36-1+deb8u2
[591880.526299] Hardware name: RDO OpenStack Compute, BIOS 1.9.1-5.el7 04/01/2014
[591880.526300] 0000000000000000 ffffffff815123b5 ffff88081f0fed20 0000000000000000
[591880.526302] ffffffff8150ff8d 0000000000000000 ffffffff810d6e3f 0000000000000000
[591880.526304] ffffffff81516d2e 0000000000000200 ffffffff810689d3 ffffffff810c43e4
[591880.526306] Call Trace:
[591880.526313] [<ffffffff815123b5>] ? dump_stack+0x5d/0x78
[591880.526318] [<ffffffff8150ff8d>] ? dump_header+0x76/0x1e8
@rmlopes
rmlopes / obspy_testlog_develop
Created May 12, 2016 15:03
Test log for ObsPy over Windows 8.1 Pro / VC++ 12.0 / Anaconda3.4 in DEVELOP mode
........................................................................................................................................................................................................E.F................ssssss...s......................sssssss......ssssss..........Running C:\Users\rmlopes\dev\obspy\obspy\scripts\runtests.py, ObsPy version '0.0.0+archive'
...............................................................................................................................................................................................................................s.................................ss...............................Warning: invalid value encountered in rint
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid value encountered in sign
Warning: invalid v
@rmlopes
rmlopes / obspy_buildlog_develop
Created May 12, 2016 10:42
Build log for ObsPy over Windows 8.1 Pro / VC++ 12.0 / Anaconda3.4 in DEVELOP mode
running develop
running build_scripts
running egg_info
running build_src
build_src
building extension "libgse2_Windows_64bit_py34" sources
building extension "libmseed_Windows_64bit_py34" sources
building extension "libsegy_Windows_64bit_py34" sources
building extension "libsignal_Windows_64bit_py34" sources
building extension "libevresp_Windows_64bit_py34" sources
@rmlopes
rmlopes / obspy_buildlog
Created May 12, 2016 10:37
Build log for ObsPy over Windows 8.1 Pro / VC++ 12.0 / Anaconda3.4
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "libgse2_Windows_64bit_py34" sources
building extension "libmseed_Windows_64bit_py34" sources
building extension "libsegy_Windows_64bit_py34" sources