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
var SimpleStorage = artifacts.require("./SimpleStorage.sol"); | |
module.exports = function(deployer) { | |
deployer.deploy(SimpleStorage); | |
}; |
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
module.exports = { | |
networks: { | |
development: { | |
host: "localhost", | |
port: 8545, | |
network_id: "*", // Match any network id | |
gas: 4600000 | |
} | |
} | |
}; |
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.5.0; | |
contract SimpleStorage { | |
mapping(address => uint256) public favoriteNumbers; | |
function setFavorite(uint x) public { | |
favoriteNumbers[msg.sender] = x; | |
} | |
function getFavorite() public view returns (uint256) { |
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
const SimpleStorage = artifacts.require("SimpleStorage") | |
contract('SimpleStorage', (accounts) => { | |
const [bob, alice] = accounts | |
it("should verify bob and alice's favorite numbers default to 0", async () => { | |
const ssContract = await SimpleStorage.deployed() | |
const bobNum = await ssContract.favoriteNumbers.call(bob) | |
assert.equal(bobNum, 0, | |
"bob's default value was non-zero") | |
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; | |
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol"; | |
contract AlamoToken is StandardToken { | |
string public name = "AlamoToken"; | |
string public symbol = "ALMO"; | |
uint8 public decimals = 4; | |
uint public INITIAL_SUPPLY = 10000000000; | |
} |
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
var AlamoToken = artifacts.require("AlamoToken"); | |
module.exports = function(deployer) { | |
deployer.deploy(AlamoToken); | |
}; |
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
var HDWalletProvider = require("truffle-hdwallet-provider"); | |
var NonceTrackerSubprovider = require("web3-provider-engine/subproviders/nonce-tracker") | |
var mnemonic = "YOUR_MNEMONIC_FROM_GANACHE" | |
var DefaultBuilder = require("truffle-default-builder"); | |
module.exports = { | |
build: new DefaultBuilder({ | |
}), |
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
package org.web3j.sample; | |
import java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import org.web3j.abi.EventEncoder; | |
import org.web3j.abi.TypeReference; | |
import org.web3j.abi.datatypes.DynamicBytes; |
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
zerohashes: bytes32[DEPOSIT_CONTRACT_TREE_DEPTH] | |
@public | |
def __init__(): | |
for i in range(DEPOSIT_CONTRACT_TREE_DEPTH - 1): | |
self.zerohashes[i+1] = sha256(concat(self.zerohashes[i], self.zerohashes[i])) |
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
# add deposit to merkle tree | |
i: int128 = 0 | |
size: uint256 = index + 1 | |
for _ in range(DEPOSIT_CONTRACT_TREE_DEPTH): | |
if bitwise_and(size, 1) == 1: | |
break | |
i += 1 | |
size /= 2 |
OlderNewer