Skip to content

Instantly share code, notes, and snippets.

pragma solidity^0.5.0;
contract Verifier {
// Returns the address that signed a given string message
function verifyString(string memory message, uint8 v, bytes32 r,
bytes32 s) public pure returns (address signer) {
// The message header; we will fill in the length next
string memory header = "\x19Ethereum Signed Message:\n000000";
@thomasmetta
thomasmetta / js
Created April 6, 2019 00:10
gbreact
[
{
"_id": "5ca7ddc6922fe7718fbd073d",
"index": 0,
"title": "MOBILDATA",
"about": "Magna eiusmod ullamco est elit laboris laborum cupidatat voluptate. Pariatur sint officia exercitation labore sit ea. Laborum consequat culpa occaecat consequat sit ut. Magna qui est velit id ipsum nisi culpa adipisicing incididunt laboris voluptate proident ipsum.\r\n",
"status": "active",
"name": "Hebert Glass"
},
{
@thomasmetta
thomasmetta / multiChannelABI.json
Last active January 15, 2019 15:57
Multi Channel ABI
[
{
"constant": false,
"inputs": [
{
"name": "_addressOfToken",
"type": "address"
},
{
"name": "_nonce",
@thomasmetta
thomasmetta / multiChannelByteCode
Created January 14, 2019 21:37
MultiChannel bytecode
608060405260018054600160a060020a0319163317905534801561002257600080fd5b50604051608080610b48833981016040818152825160208085015183860151606096870151600160a060020a0380831660008181528087528890208054600182018054600160a060020a0319908116868c16179182905560028401805460038601805433908516179081905594831690961760a060020a60c060020a0319167401000000000000000000000000000000000000000063ffffffff8a160217909455939093168488161760a060020a60ff02191690915590821689521693870193909352438587015293519295909491927ff7c5f7121b328ce5c14248edc6c3d6586da8cbe83629772d98020bd18a2defec9281900390910190a150505050610a198061012f6000396000f3006080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633496012f81146100845780634639ada9146100bc5780636a256b29146100dd5780639cdf3a1a146100fe578063a2d903c214610131578063a3230bad14610167578063fb5115721461019d575b005b34801561009057600080fd5b50610082600160a060020a036004351660243560443560ff6064351660843560a43560c4351515610216565b3480156100c857600080fd5b50610082600160a0
@thomasmetta
thomasmetta / paymentChannelDeploy.js
Last active January 14, 2019 21:04
Deploy STK payment channel example
const contractParam = [_from, _addressOfSigner, _addressOfToken, _expiryNumberOfBlocks];
const channelContract = web3.eth.contract(STKChannelABI);
const bytecode = "608060405260018054600160a060020a0319163317905534801561002257600080fd5b50604051608080610b48833981016040818152825160208085015183860151606096870151600160a060020a0380831660008181528087528890208054600182018054600160a060020a0319908116868c16179182905560028401805460038601805433908516179081905594831690961760a060020a60c060020a0319167401000000000000000000000000000000000000000063ffffffff8a160217909455939093168488161760a060020a60ff02191690915590821689521693870193909352438587015293519295909491927ff7c5f7121b328ce5c14248edc6c3d6586da8cbe83629772d98020bd18a2defec9281900390910190a150505050610a198061012f6000396000f3006080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633496012f81146100845780634639ada9146100bc5780636a256b29146100dd5780639cdf3a1a146100fe578063a2d903c214610131578063a3230bad14610167578063fb511572146
0x6df56CE0F647556bBB31a51F7d630b4089CD568E