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 / contracts...MoveFunds.sol
Created February 3, 2023 20:06
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
interface IHederaTokenService {
function associateToken(address account, address token) external returns (int responseCode);
function transferToken(address token, address sender, address recipient, int64 amount) external returns (int responseCode);
}
contract MoveFunds {
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract EIP_196_197 {
// After calling testAdd() output variable cointains these values:
// - output[0] == 0x030644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd3
// - output[1] == 0x15ed738c0e0a7c92e7845f96b2ae9c0a68a6a449e3538fc7ff3ebf7a5a18a2c4
uint256[2] public output;
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
abstract contract CheckEIP20TokenInfo {
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
function balanceOf(address _owner) virtual public returns (uint256 balance);
function allowance(address _owner, address _spender) virtual public returns (uint256 remaining);
@Neurone
Neurone / stackExchange_85231_array-of-mapping.sol
Last active July 23, 2020 22:28
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=7f4de04ec5e3e926af27d5cd437aa8e2
// https://ethereum.stackexchange.com/questions/85231/array-of-mapping
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.8.0;
contract myContract {
mapping (address => mapping (uint => uint)) public payments;
mapping (address => uint) public lastPayment;
@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();
@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;
{
"poiDataTags": [{
"tag": "POITag",
"contents": "Attraction"
}, {
"tag": "POITag",
"contents": "Retail"
}, {
"tag": "POITag",
"contents": "Food"
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;
@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:

@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]
]