New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@requestnetwork/smart-contracts

Package Overview
Dependencies
Maintainers
6
Versions
665
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@requestnetwork/smart-contracts

Smart contracts for the Request protocol.

  • 0.2.1-next.1160
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by99.41%
Maintainers
6
Weekly downloads
 
Created
Source

@requestnetwork/smart-contracs

@requestnetwork/smart-contracts is a package part of the Request Network protocol. The package stores the sources and artifacts of the smart contracts deployed on Ethereum. It also exposes a library to get information about the artifacts.

Installation

npm install @requestnetwork/smart-contracts

Usage

Library usage:

import * as SmartContracts from '@requestnetwork/smart-contracts';

const requestHashStorageMainnetAddress = SmartContracts.requestHashStorageArtifact.getAddress(
  'mainnet',
);

const requestHashSubmitterRinkebyAddress = SmartContracts.requestHashSubmitterArtifact.getAddress(
  'rinkeby',
);

const requestHashStorageABI = SmartContracts.requestHashStorageArtifact.getContractAbi()

Smart Contract

The package stores the following smart contracts:

Smart contracts for ethereum-storage package

  • RequestHashStorage allows to declare a hash NewHash(hash, submitter, feesParameters). Only a whitelisted contract can declare hashes.
  • RequestOpenHashSubmitter entry point to add hashes in RequestHashStorage. It gives the rules to get the right to submit hashes and collect the fees. This contract must be whitelisted in RequestHashStorage. The only condition for adding hash is to pay the fees.
  • StorageFeeCollector parent contract (not deployed) of RequestOpenHashSubmitter, computes the fees and send them to the burner.

Smart contracts for advanced-logic package

  • TestERC20 minimal erc20 token used for tests.
  • ERC20Proxy smart contract used by the erc20 proxy contract payment network to store payment references of erc20 transfers
Smart contracts local deployment

The smart contracts can be deployed locally with the following commands:

git clone https://github.com/RequestNetwork/requestNetwork.git
cd requestNetwork/packages/smart-contracts
yarn install
yarn run build
yarn run ganache

And in another terminal:

yarn run deploy
Configuring the provider using Truffle and the development network

When deploying the smart contracts for development you can manually set the provider host and port via env variables:

TRUFFLE_GANACHE_HOST="host" TRUFFLE_GANACHE_PORT=1010 yarn run deploy

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Read the contributing guide

License

MIT

Keywords

FAQs

Package last updated on 15 Jan 2020

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