Skip to content

Instantly share code, notes, and snippets.

View Neurone's full-sized avatar
💭
Spreading the web 3.0 approach to the world

Giuseppe Bertone Neurone

💭
Spreading the web 3.0 approach to the world
View GitHub Profile
@Neurone
Neurone / ContractInheritance.sol
Created May 28, 2016 11:30
This gist explains some misunderstandings about Solidity constructors parameters and inheritance
// This gist explains some misunderstandings about Solidity constructors parameters and inheritance
// Base contract to extend
contract BaseContract {
function BaseContract(bool myVar) {}
}
// Wrong way to extend a contract that use parameters in its own constructor
contract ExtendedContract_WrongConstructor is BaseContract {
bool _myVar;
results([
[Date.parse("2015-07-30T00:00:00.000+02:00"),10],
[Date.parse("2015-07-31T00:00:00.000+02:00"),10],
[Date.parse("2015-08-01T00:00:00.000+02:00"),10],
[Date.parse("2015-08-02T00:00:00.000+02:00"),10],
[Date.parse("2015-08-03T00:00:00.000+02:00"),10],
[Date.parse("2015-08-04T00:00:00.000+02:00"),10],
[Date.parse("2015-08-05T00:00:00.000+02:00"),10],
[Date.parse("2015-08-06T00:00:00.000+02:00"),10],
[Date.parse("2015-08-07T00:00:00.000+02:00"),10],
@Neurone
Neurone / aa
Created September 1, 2016 22:09
?([
[Date.UTC(2013,5,2),0.7695],
[Date.UTC(2013,5,3),0.7648],
[Date.UTC(2013,5,4),0.7645],
[Date.UTC(2013,5,5),0.7638],
[Date.UTC(2013,5,6),0.7549],
[Date.UTC(2013,5,7),0.7562],
[Date.UTC(2013,5,9),0.7574],
[Date.UTC(2013,5,10),0.7543],
[Date.UTC(2013,5,11),0.7510],
@Neurone
Neurone / ewe.json
Last active September 1, 2016 22:34
[Date.UTC(2013,5,2),0.7695],
[Date.UTC(2013,5,3),0.7648],
[Date.UTC(2013,5,4),0.7645],
[Date.UTC(2013,5,5),0.7638],
[Date.UTC(2013,5,6),0.7549],
[Date.UTC(2013,5,7),0.7562],
[Date.UTC(2013,5,9),0.7574],
[Date.UTC(2013,5,10),0.7543],
[Date.UTC(2013,5,11),0.7510],
[Date.UTC(2013,5,12),0.7498],
@Neurone
Neurone / sda
Last active September 1, 2016 22:24
[
[Date.parse("2015-07-27T00:00:00.000+02:00"),12],
[Date.parse("2015-07-28T00:00:00.000+02:00"),5],
[Date.parse("2015-07-29T00:00:00.000+02:00"),18],
[Date.parse("2015-07-30T00:00:00.000+02:00"),13]
]
@Neurone
Neurone / keybase.md
Created January 9, 2017 00:58
Keybase proof of ownership

Keybase proof

I hereby claim:

  • I am neurone on github.
  • I am bertone (https://keybase.io/bertone) on keybase.
  • I have a public key ASB1r281ugjTGCT66DOtYVAYjmFV54mFFbXqUwo7RoQYRQo

To claim this, I am signing this object:

pragma solidity ^0.4.19;
contract DecimalsTest {
uint256 public decimals256;
uint256 public totalSupply256_AsExpected_1;
uint256 public totalSupply256_AsExpected_2;
uint8 public decimals8;
uint256 public totalSupply256_Unexpected_1;
{
"poiDataTags": [{
"tag": "POITag",
"contents": "Attraction"
}, {
"tag": "POITag",
"contents": "Retail"
}, {
"tag": "POITag",
"contents": "Food"
@Neurone
Neurone / stackExchange_84109_structWithMapping.sol
Last active July 23, 2020 16:42
Load this file into remix-ide (Realtime Ethereum Contract Compiler and Runtime) by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.9+commit.3e3065ac.js&optimize=false&gist=83876bb40c75640d5fa13cb0b4a0ed78
// https://ethereum.stackexchange.com/questions/84109/solidity-0-4-26-check-if-element-already-exists-in-array
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity >=0.6.9 <0.7.0;
contract stackExchange_84109_structWithMapping {
struct User {
string username;
@Neurone
Neurone / stackExchange_85224_access-tuples-elements.sol
Last active July 23, 2020 16:42
Load this file into remix-ide (Realtime Ethereum Contract Compiler and Runtime) by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.9+commit.3e3065ac.js&optimize=false&gist=83bfbd85ef79387f760154999eb4f192
// https://ethereum.stackexchange.com/questions/85224/access-tuples-elements
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.8.0;
contract myContract {
uint index;
function myFunction() public {
( , , uint256 standardDepositAmount, , ) = returnTuple();