Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@giveth/bridge

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giveth/bridge

Mainnet -> sidechain Giveth Bridge.

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Giveth Bridge

Giveth specific bridge between 2 ethereum based blockchains

General idea

home chain -> foreign chain:

GivethBridge contract will be deployed on the home chain. When one donate functions are called, the sent value is locked in the bridge and an event is emitted. A node app will be watching for events and relay to the foreignChain, calling the deposit function. This will mint tokens and forward the donation to the liquidPledging contract.

foreign chain -> home chain:

ForeignGivethBridge contract will be deployed on the foreign chain. When a user wants to move tokens to the home chain they will call the withdraw function. The tokens will then be burnt and an event is emitted. A node app will be watching for events and relay to the homeChain, calling the authorizePayment function. Once the payment is approved, the sender will be able to collect their funds from the GivethBridge contract.

The GivethBridge contract is an extension of the vault, which provides a safe and secure way to store funds. Vist the vault repo to lean more about the vault.

Currently these contracts are a temporary solution until, a more robust bridging system is ready. Both contracts are pausable which will allow use to migrate to a new bridge at a future date.

Config

See config/default.json for example. This will be loaded and extended by additional configuration if found. You can specify the ENVIRONMENT env variable to load the file config/${ENVIRONMENT}.json if found. ENVIRONMENT defaults to local.

dataDir: directory to store bridge db homeNodeUrl: ethereum node connection url for homeBridge homeBridge: address of the home bridge homeGasPrice: price in wei to use for gas (can be set to 'ethGasStationto fetch current price)homeConfirmations: # of confirmations required before relaying tx to foreignBridge homeBridgeDeployBlock: (optional) block to start looking for events from foreignNodeUrl: ethereum node connection url for foreignBridge foreignBridge: address of the foreign bridge foreignGasPrice: price in wei to use for gas (can be set to 'ethGasStation to fetch current price) foreignConfirmations: # of confirmations required before relaying tx to homeBridge foreignBridgeDeployBlock: (optional) block to start looking for events from pollTime: how often in miliseconds to check for txs to relay liquidPledging: address of liquidPledging contract on foreign network pk: pk of the account to send txs from

If you would like to receive an email on any errors, the following are required:

`mailApiKey`: mailgun api key
`mailDomain`: mailgun domain
`mailFrom`: address to send mail from
`mailTo`: address sto send mail to

Upgrading

see Upgrade doc

Help

Reach out to us on join for any help or to share ideas.

Keywords

FAQs

Package last updated on 04 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc