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

@maticnetwork/pos-portal

v1.5.2

Published

Contracts to facilitate transfer of assets between Ethereum Main Network and Matic Network, using security of Matic POS layer

Downloads

88

Readme

Matic PoS (Proof-of-Stake) portal contracts

Build Status

Smart contracts that powers the PoS (proof-of-stake) based bridge mechanism for Matic Network.

Audit - Matic Audit CertiK Report.pdf

Usage

Install package from NPM using

npm i @maticnetwork/pos-portal

Setup

git clone https://github.com/maticnetwork/pos-portal
cd pos-portal

npm install

Compile all contracts

npm run template:process
npm run build

Start main chain and child chain

Start Main chain

npm run testrpc

Start Matic child chain (Requires docker)

npm run bor

If you ran a bor instance before, a dead docker container might still be lying around, clean it using following command:

npm run bor:clean

Run testcases

npm run test

Deploy contracts locally

npm run migrate

Deploy contracts on mainnet

  1. Moonwalker needs rabbitmq and local geth running
docker run -d -p 5672:5672 -p 15672:15672 rabbitmq:3-management
npm run testrpc
  1. Export env vars
export MNEMONIC=
export FROM=
export PROVIDER_URL=
export ROOT_CHAIN_ID=
export CHILD_CHAIN_ID=
export PLASMA_ROOT_CHAIN=
export GAS_PRICE=
  1. Compile contracts
npm run template:process -- --root-chain-id $ROOT_CHAIN_ID --child-chain-id $CHILD_CHAIN_ID
npm run build
  1. Add root chain contract deployments to queue
npm run truffle exec moonwalker-migrations/queue-root-deployment.js
  1. Process queue (rerun if interrupted)
node moonwalker-migrations/process-queue.js
  1. Extract contract addresses from moonwalker output
node moonwalker-migrations/extract-addresses.js
  1. Deploy child chain contracts
npm run truffle -- migrate --network mainnetChild --f 3 --to 3
  1. Add root chain initializations to queue
node moonwalker-migrations/queue-root-initializations.js
  1. Process queue (rerun if interrupted)
node moonwalker-migrations/process-queue.js
  1. Initialize child chain contracts
npm run truffle -- migrate --network mainnetChild --f 5 --to 5
  1. Register State Sync
  • Register RootChainManager and ChildChainManager on StateSender
  • Set stateSenderAddress on RootChainManager
  • Grant STATE_SYNCER_ROLE on ChildChainManager

Command scripts (Management scripts)

npm run truffle exec scripts/update-implementation.js -- --network <network-name> <new-address>

Transfer proxy ownership and admin role

Set list of contract addresses and new owner address in 6_change_owners.js migration script
Set MNEMONIC and API_KEY as env variables

npm run change-owners -- --network <network-name>