Skip to content

Instantly share code, notes, and snippets.

View andreafspeziale's full-sized avatar

Andrea Francesco Speziale andreafspeziale

View GitHub Profile
function getHash(
    address _signer,
    address _recipient,
    uint _transactionObjectValueField,
    bytes memory _transactionObjectDataField,
    address _rewardTokenAddress,
    uint _rewardAmount
)
 public
@andreafspeziale
andreafspeziale / Eidoo Hybrid Exchange CLI Sheet.md
Last active August 2, 2019 12:50
Eidoo Hybrid Exchange CLI samples

Eidoo Hybrid Exchange CLI sheet

All the following commands are runned from the https://github.com/eidoo/hybrid-exchange-sdk root folder.

CREATE KEYSTORE

node bin/hybrid-exchange-cli.js ethereum-wallet keystore-generate --ksp .

CREATE TRADING WALLET

node bin/hybrid-exchange-cli.js trading-wallet create-wallet --eoa EXTERNAL_OWNED_ACCOUNT --ksp KEYSTORE_PATH

@andreafspeziale
andreafspeziale / cleaneos.sh
Created April 11, 2019 11:38
Basic EOS node cleaner based on the bootstrap script using Docker.
echo "Stopping container.."
docker stop keosd
docker stop nodeos
echo "Removing container.."
docker rm keosd
docker rm nodeos
echo "Removing network.."
docker network rm eosdev
@andreafspeziale
andreafspeziale / starteos.sh
Created April 11, 2019 11:07
Basic EOS node bootstrap using Docker.
# be sure that the docker daemon is running before you start this script
#
# this script will create an alias at the end, so please run it with:
#
# source starteos.sh
#
# see https://developers.eos.io/eosio-nodeos/docs/docker-quickstart
docker pull eosio/eos-dev:v1.2.5 # pull eosio image
docker network create eosdev # create an eos network(see docker networking)
pragma solidity ^0.5.2;

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
    function transfer(address to, uint256 value) external returns (bool);
contract Wallet {
  ...
  address public logic_;
  /**
   * @dev Deposit any ERC20 token into this wallet.
   * @param _token The address of the existing token contract.
   * @param _amount The amount of tokens to deposit.
   * @return Bool if the deposit was successful.
 */
@andreafspeziale
andreafspeziale / # Get Smart Contract instance bytecode and hashed bytecode.md
Last active August 26, 2023 13:16
# Get Smart Contract instance bytecode and hashed bytecode

Get Smart Contract instance bytecode and hashed bytecode

Minimal SC sample exposing a way to get the bytecode and the hashed bytecode of a deployed smart contract.
This without the new OPCODE of EIP1052

pragma solidity ^0.4.24;

contract SomeContractInstance {
    constructor () public {}
}
@andreafspeziale
andreafspeziale / Next-Gen JavaScript.md
Last active September 27, 2018 10:52
Some Next-Gen JavaScript hints
@andreafspeziale
andreafspeziale / JavaScript array functions.md
Last active August 30, 2018 20:55
JavaScript array functions resources
@andreafspeziale
andreafspeziale / FlaskApache2.md
Last active August 16, 2018 10:10
Flask - Apache2 deployed app structure

Flask - Apache2

Project structure

Useful link for requirements: How To Deploy a Flask Application on an Ubuntu VPS

Under /var/www folder you should have a structure like following

/var/www/
/var/www/project-name/
/var/www/project-name/project-name.wsgi
/var/www/project-name/project/__init__.py