Skip to content

Instantly share code, notes, and snippets.

Philippe Castonguay PhABC

Block or report user

Report or block PhABC

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ERC1155Proxy.js
/*
Copyright 2018 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
View totalTxFeeEthereum.sql
/*
Calculate the total amount of transaction fee since January 1st 2017 (block 2912407), with weithed
average price of Ether as 492.
NOTE: Need to divide gas_price by 10 to prevent overflow in BigQuery.
*/
SELECT
SUM(gas_price/10 * receipt_gas_used) / POWER(10, 17) * 492
FROM
View TokenSale_GasTokenFactory.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
View Transcripts.sol
pragma solidity ^0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
View contractStorageSize.js
//Imports
var Trie = require('merkle-patricia-tree');
var rlp = require('rlp');
var levelup = require('levelup');
var leveldown = require('leveldown');
var keccak256 = require('js-sha3').keccak256;
// Chains' path
var dbPathRinkeby = '/home/user/.ethereum/rinkeby/geth/chaindata';
var dbPathMainnet = '/home/user/.ethereum/geth/chaindata';
View DelayedDestructible.sol
pragma solidity ^ 0.4.18;
import "../ownership/Ownable.sol";
/**
* @title DelayedDestructible
* @dev Contract that can be selfdestructed after a delay period.
*/
contract DelayedDestructible is Ownable {
View OZWhitelist.sol
pragma solidity ^ 0.4.18;
import "../../ownership/Ownable.sol";
/**
* @title WhitelistedCrowdsale
* @dev Crowdsale in which only whitelisted users can contribute.
*/
contract Whitelisted is Ownable {
View ControlledAccess.sol
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
View ECDSAparameters.js
//Extracting ECDSA variables
var r = sign.substr(0, 66);
var s = '0x' + sign.substr(66, 64);
var v = '0x' + sign.substr(130,2);
View accessMessageHash.js
// Message to sign : contract address + address to give access
var message = web3.sha3(contractAddress.substr(2) + userAddress.substr(2), {encoding: 'hex'})
// Signing message (with "\x19Ethereum Signed Message:\n32" as prefix by default)
web3.personal.sign(message, web3.eth.defaultAccount, (err, res) => sign = res)
You can’t perform that action at this time.