Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0; | |
contract Ownable | |
{ | |
// Variable that maintains | |
// owner address | |
address private _owner; | |
// Sets the original owner of |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0; | |
contract check_private { | |
// Declaring private variable | |
uint private _number =2; | |
// Can you check what is private variable | |
// from the contract ? |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0; | |
// Defining parent contract | |
contract School { | |
// Declaring variable in the parent contract | |
string public school = "Shmorse School of Solidity"; | |
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
#!/bin/bash | |
# Prerequisites (macOS): | |
# - aws cli => to create AWS resources | |
# => pip install --upgrade --user awscli | |
# => aws configure | |
# - jq => to parse JSON results returned by the AWS CLI | |
# => brew install jq |
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
class Blockchain { | |
// Method 1: Initiate, and store blockchain in LevelDB | |
constructor(){ | |
this.chain = level('./blockchaindata'); | |
this.chain.put(0,JSON.stringify(Block.genesisBlock())) | |
} | |
// Method 2: Add new block to LevelDB |
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
const SHA256 = require('crypto-js/sha256'); | |
class Block { | |
constructor(data){ | |
this.hash = "", | |
this.height = 0, | |
this.body = data, | |
this.time = 0, | |
this.previousBlockHash = "" | |
} |