npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@renproject/gateway-sol

v2.0.6

Published

## EVM contracts for minting and burning ren-assets

Downloads

59

Readme

⛩️ gateway-sol

EVM contracts for minting and burning ren-assets

Ren has two repositories for its Solidity contract:

  • darknode-sol - contracts on Ethereum for managing darknode registrations.
  • gateway-sol (this repository) - contracts on multiple EVM chains for minting and burning of ren-assets.

~ Documentation ~

Contract summary

There are three core layers in the gateway-sol contracts:

  • GatewayRegistry - responsible for deploying and tracking gateway and asset instances
  • RenAsset - ERC20s backed 1:1 by a corresponding asset on another chain. e.g. renDAI on Fantom is backed by DAI on Ethereum
  • Gateways - responsible for minting and burning (MintGateway) and locking and releasing (LockGateway) Ren assets.

gateway-sol diagram

For example, minting renDAI on Fantom backed by DAI on Ethereum involves the following contracts:

  • On Ethereum:
    • The Ethereum GatewayRegistry
    • A DAI LockGateway
  • On Fantom:
    • The Fantom GatewayRegistry
    • A DAI MintGateway
    • A renDAI RenAsset

INSTALL

yarn

TEST

yarn test

SCRIPTS

Here is the list of npm scripts you can execute:

Some of them relies on ./config/_scripts.js to allow parameterizing it via command line argument (have a look inside if you need modifications)

yarn prepare

As a standard lifecycle npm script, it is executed automatically upon install. It generate config file and typechain to get you started with type safe contract interactions

yarn lint, yarn lint:fix, yarn format and yarn format:fix

These will lint and format check your code. the :fix version will modifiy the files to match the requirement specified in .eslintrc and and the prettier config in package.json

yarn compile

These will compile your contracts

yarn void:deploy

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. quick way to ensure deployments work as intended without consequences

yarn test [mocha args...]

These will execute your tests using mocha. you can pass extra arguments to mocha

yarn coverage

These will produce a coverage report in the coverage/ folder

yarn gas

These will produce a gas report for function used in the tests

yarn dev

These will run a local hardhat network on localhost:8545 and deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn local:dev

This assumes a local node it running on localhost:8545. It will deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn execute <network> <file.ts> [args...]

This will execute the script <file.ts> against the specified network

yarn deploy <network> [args...]

This will deploy the contract on the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn export <network> <file.json>

This will export the abi+address of deployed contract to <file.json>

yarn fork:execute <network> [--blockNumber <blockNumber>] [--deploy] <file.ts> [args...]

This will execute the script <file.ts> against a temporary fork of the specified network

if --deploy is used, deploy scripts will be executed

yarn fork:deploy <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a temporary fork of the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn fork:test <network> [--blockNumber <blockNumber>] [mocha args...]

This will test the contract against a temporary fork of the specified network.

yarn fork:dev <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a fork of the specified network and it will keep running as a node.

Behind the scene it uses hardhat node command so you can append any argument for it

Verifying

yarn hardhat --network kovan etherscan-verify --api-key ETHERSCAN_KEY --license GPL-3.0

For contracts that use a Proxy, you then need to go to the Etherscan page, select "More Options" and then "Is this a proxy?":

image