This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auth: | |
| type: "object" | |
| required: | |
| - "hash" | |
| - "v" | |
| - "r" | |
| - "s" | |
| properties: | |
| hash: | |
| type: "string" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function negModN(uint256 s) returns(bytes32){ | |
| return bytes32(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s); | |
| } //0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is the order of the Ethereum elliptic curve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function claimOwnership(uint8 v, bytes32 r, bytes32 s) public returns (bool) { | |
| require(validSignature(v, r, s)); | |
| invalidateSignature(v, r, s); | |
| if (ecrecover(keccak256("emergency ownership transfer"), v, r, s) == owner) { | |
| address oldOwner = owner; | |
| owner = msg.sender; | |
| emit EmergencyOwnershipTransfer(oldOwner, msg.sender); | |
| return true; | |
| } | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should set prices correctly for multiple buy sell orders for a single crypto', async function () { | |
| let price = await this.investment.decodePrices.call([1, 1, 1],"{\"COIN\":{\"USD\":0.1554},\"BTC\":{\"USD\":8180.87}}", true) | |
| price[1].should.be.bignumber.equal(toEther(8180.87)) | |
| price[2].should.be.bignumber.equal(toEther(8180.87)) | |
| price[3].should.be.bignumber.equal(toEther(8180.87)) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.4.24; | |
| contract stateChannel{ | |
| uint blockPeriod; | |
| uint neededSignatures; | |
| struct participant{ | |
| bool isNeeded; | |
| uint256 block; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma experimental ABIEncoderV2; | |
| pragma solidity ^0.4.24; | |
| library merkleMap{ | |
| struct node{ | |
| bytes32 key; | |
| bytes32 value; | |
| bytes32 leftChildHash; | |
| bytes32 rightChildHash; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let Deposit = artifacts.require("./DepositContract") | |
| let Flame = artifacts.require("./FlameToken") | |
| let Master = artifacts.require("./MasterDeposit") | |
| contract("DepositContract", function(accounts) { | |
| let deposit | |
| let master | |
| let someone = accounts[0] | |
| let token | |
| let sender = accounts[1] |
NewerOlder