This file contains 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
var calculateHashForBlock = (block) => { | |
return calculateHash(block.index, block.previousHash, block.timestamp, block.data); | |
}; | |
var calculateHash = (index, previousHash, timestamp, data) => { | |
return CryptoJS.SHA256(index + previousHash + timestamp + data).toString(); | |
}; |
This file contains 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
export var write = (ws, message) => | |
{ | |
if(message.hasOwnProperty('data')){ | |
var temp = JSON.parse(message.data); | |
if(temp.length == 1) | |
delete temp[0]['extraData']; | |
else{ | |
for(var i=1;i<temp.length;i++) | |
delete temp[i]['extraData']; | |
} |
This file contains 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
contract EthereumClaimsRegistry { | |
mapping(address => mapping(address => mapping(bytes32 => bytes32))) public registry; | |
event ClaimSet( | |
address indexed issuer, | |
address indexed subject, | |
bytes32 indexed key, | |
bytes32 value, | |
uint updatedAt); |
This file contains 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
{ | |
"payload": { | |
"data": { | |
"config_update": { | |
"channel_id": "firstchannel", | |
"isolated_data": {}, | |
"read_set": { | |
"groups": { | |
"Application": { | |
"groups": { |
This file contains 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.22 <0.7.0; | |
import "remix_tests.sol"; // this import is automatically injected by Remix | |
import "remix_accounts.sol"; | |
import "./Sender.sol"; | |
// Inherit 'Sender' contract | |
contract SenderTest is Sender { | |
address account0; | |
address account1; | |
address account2; | |
This file contains 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
// this line is added to create a gist. Empty file is not allowed. |
This file contains 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
// this line is added to create a gist. Empty file is not allowed. |
This file contains 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
// this line is added to create a gist. Empty file is not allowed. |
This file contains 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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
This file contains 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
REMIX DEFAULT WORKSPACE | |
Remix default workspace is present when: | |
i. Remix loads for the very first time | |
ii. A new workspace is created with 'Default' template | |
iii. There are no files existing in the File Explorer | |
This workspace contains 3 directories: | |
1. 'contracts': Holds three contracts with increasing levels of complexity. |
OlderNewer