1.3.0 • Published 5 years ago

@wetrustplatform/forward-contracts v1.3.0

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
5 years ago

Build Status

Forward Contracts

Overview

Smart contracts to forward ETH to a pre-defined address.

Requirements

  • Accept incoming transactions from both normal and contract addresses. Be able to recieve any ETH/Tokens intentionally or unintentionally.
  • Contract's balance (ETH and/or tokens) must be able to move to the pre-defined recipient i.e. we don't want money to be burned/stuck/lost in this contract in any cases.
  • Contracts are pre-generated with Recipient's address being assigned in the constructor.
  • Forwarding happens in a passive mode which requires a trigger to sweep the balance.
  • Recipient can call other smart contracts via a proxy method. This is to recover ERC20 mistakenly sent to the Forward contract.
  • Stateless, should not have any internal states except the recipient. In other words, it only serves one purpose which is forwarding the fund.

Getting started

  • npm install
  • (Optional) Install ganache: https://truffleframework.com/ganache
  • After sending ETH to the Forwarder contract, call sweep method to forward the balance to the pre-defined recipient

Use as node_modules

import contracts from '@wetrustplatform/forward-contracts;

// Available fields are shown in the ./dist.js 
const { abi, bytecode, source } = contracts.PassiveForwarder;

These fields are copied from the ./build folder generated by npm run compile

License

GPL-3.0 © WeTrustPlatform