Skip to content

Instantly share code, notes, and snippets.

View patitonar's full-sized avatar

Gerardo Nardelli patitonar

View GitHub Profile
/**
*Submitted for verification at Etherscan.io on 2018-12-19
*/
pragma solidity 0.4.24;
// File: contracts/ERC677Receiver.sol
contract ERC677Receiver {
function onTokenTransfer(address _from, uint _value, bytes _data) external returns(bool);
// File: contracts/libraries/SafeMath.sol
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
@patitonar
patitonar / BridgeValidators.sol
Created December 9, 2019 18:03
BridgeValidators.sol for foreign xDai bridge in ethereum mainnet. Related to https://github.com/poanetwork/tokenbridge-contracts/pull/319
// File: contracts/upgradeability/EternalStorage.sol
pragma solidity 0.4.24;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
@patitonar
patitonar / ForeignBridgeErcToNative.sol
Created December 9, 2019 18:05
ForeignBridgeErcToNative.sol for foreign xDai bridge in ethereum mainnet. Related to https://github.com/poanetwork/tokenbridge-contracts/pull/319
// File: contracts/upgradeability/EternalStorage.sol
pragma solidity 0.4.24;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
@patitonar
patitonar / HomeBridgeErcToNative.sol
Created December 9, 2019 18:06
HomeBridgeErcToNative.sol for home xDai bridge in xDai chain. Related to https://github.com/poanetwork/tokenbridge-contracts/pull/319
// File: contracts/interfaces/IBridgeValidators.sol
pragma solidity 0.4.24;
interface IBridgeValidators {
function isValidator(address _validator) external view returns (bool);
function requiredSignatures() external view returns (uint256);
function owner() external view returns (address);
}
@patitonar
patitonar / BaseMediatorFeeManager.sol
Created March 27, 2020 19:33
BaseMediatorFeeManager with linkedList
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title BaseMediatorFeeManager
* @dev Base fee manager to handle fees for AMB mediators.
*/
contract BaseMediatorFeeManager is Ownable {
@patitonar
patitonar / ForeignBridgeErcToNative.sol
Last active April 15, 2020 22:07
ForeignBridgeErcToNative implementation for xdai bridge that disables sai swap to dai
// File: contracts/upgradeability/EternalStorage.sol
pragma solidity 0.4.24;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
@patitonar
patitonar / PublishNPMPackage.md
Last active April 22, 2020 13:22
Instructions to publish tokenbridge-plugin to npm

Information

The package to be published gets its configuration from tokenbridge/burner-wallet-plugin/tokenbridge-plugin/package.json

{
  "name": "tokenbridge-plugin",
  "version": "1.0.0",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
contracts/MonthlyMint.sol
  18:97  warning  Visibility modifier must be first in list of modifiers     visibility-modifier-order
  20:18  warning  Avoid to make time-based decisions in your business logic  not-rely-on-time
  28:5   warning  Error message for require is too long                      reason-string
  32:7   warning  Error message for require is too long                      reason-string
  42:38  warning  Avoid to make time-based decisions in your business logic  not-rely-on-time
  48:5   warning  Error message for require is too long                      reason-string

contracts/TokenDispenser.sol

0x219ddeafe53416d916d78470eaa49457bdfdd91c39c222dd513f39207bec77b7