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
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", | |
port: 7545, | |
network_id: "5777", | |
} | |
} | |
} |
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.5.0; | |
contract HelloWorld { | |
string private greeting; | |
constructor() public { | |
greeting = "Hello World"; | |
} | |
function getGreeting() public view returns(string memory){ |
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 HelloWorld = artifacts.require("HelloWorld"); | |
module.exports = function(deployer) { | |
deployer.deploy(HelloWorld); | |
}; |
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.5.0; | |
import "truffle/Assert.sol"; | |
import "truffle/DeployedAddresses.sol"; | |
import "../contracts/HelloWorld.sol"; | |
contract TestHelloWorld { | |
function testItGreets() public { | |
// Get the deployed contract | |
HelloWorld helloWorld = HelloWorld(DeployedAddresses.HelloWorld()); |
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 HDWalletProvider = require('truffle-hdwallet-provider-privkey'); | |
const privateKey = "private-key-goes-here"; | |
const endpointUrl = "endpoint-goes-here"; | |
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", | |
port: 7545, | |
network_id: "5777", |
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
{ | |
"dependencies": { | |
"truffle-hdwallet-provider": "1.0.4", | |
"truffle-hdwallet-provider-privkey": "1.0.3", | |
"web3": "1.0.0-beta.46" | |
} | |
} |
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 path = require("path"); | |
module.exports = { | |
contracts_build_directory: path.join(__dirname, "client/src/contracts"), | |
networks: { | |
development: { | |
host: "127.0.0.1", | |
port: 7545, | |
network_id: "5777", | |
} |
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 HelloWorld = artifacts.require("HelloWorld"); | |
const SimpleStorage = artifacts.require("SimpleStorage"); | |
module.exports = function(deployer) { | |
deployer.deploy(HelloWorld); | |
deployer.deploy(SimpleStorage); | |
}; |
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
import React, { Component } from "react"; | |
import SimpleStorageContract from "./contracts/SimpleStorage.json"; | |
import HelloWorld from "./contracts/HelloWorld.json"; | |
import getWeb3 from "./getWeb3"; | |
import "./App.css"; | |
class App extends Component { | |
state = { storageValue: 0, web3: null, accounts: null, contract: null }; |
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.5.0; | |
contract Background { | |
uint[] private values; | |
function storeValue(uint value) public { | |
values.push(value); | |
} | |
function getValue(uint initial) public view returns(uint) { |