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

@floki-inu/contracts

v1.13.0

Published

We use hardhat for local development.

Downloads

74

Readme

FlokiFi-contracts

We use hardhat for local development.

For deployment and contract verification, we use hardhat-deploy.

The relevant folders are:

  • contracts: for all our smart contracts.
  • deploy: contains scripts for deploying smart contracts.
  • deployments: contains the artifacts of deployed smart contracts.
  • src: contains typescript types for our smart contracts.
  • test: contains our tests, which run against mainnet forks.

There is a file src/config.ts which contains config for all the networks we support, for all projects (e.g. Locker, Staking, Token Launcher).

This file should not have sensitive data, as this is committed to git. Any setup required for deployment or testing that may change between one network and another should be in this file.

Deploy the contracts

There is a .env.example file. Duplicate it and rename it to .env, this file is in gitignore and should never be committed.

For deploying, it requires three variables:

  • DEPLOYER_ADDRESS: The wallet address used for deploying contracts. This is for all chains.
  • REMOTE_SIGNER_HOST: The host of the Floki Signer App, used for remotely signing transactions.
  • SIGNER_TOKEN: An AWS Cognito access token for authenticating with the Signer App.

You can ask another dev for the first two. The third one we'll see soon.

We do not keep private keys locally as it's not safe. So we extend hardhat using a custom provider which sends transactions to the signer app, which runs in an isolated environment without internet access within our cluster.

AWS Cognito Setup

The Signer App requires authentication. First, you need to create a user on AWS Cognito.

Go to our Sign Up page and register. If it shows an error message after you register, you can ignore.

Ask an AWS admin to approve your Cognito account.

Once approved, you can login through the Sign In page.

You'll be required to setup MFA. You can use Authy, Google Authenticator or some other TOTP app on your smartphone (or some other device).

Scan the QR Code on the app, provide the code generated by the app, and give your device a name (e.g. My Smartphone). If the login succeeds, you should be redirected to flokifi.com.

Generate Tokens

With your login working and MFA enabled, you can now generate tokens for deploying contracts.

You need AWS CLI installed.

We have a bash script .auth.sh to make it easier generating tokens. You can use it like this:

yarn auth

The script will prompt you for your Cognito Username, Password, and the MFA Code which you can get from the TOTP app you used (e.g. Authy).

This script will update the SIGNER_TOKEN key from the .env file with an access token from Cognito, which is valid for 1 hour.

Now you can proceed to deploying with hardhat.

Deploy commands

yarn hardhat deploy --network goerli --tags Locker
yarn hardhat deploy --network goerli --tags Staking
yarn hardhat deploy --network goerli --tags TokenLauncher

Verify the contracts

yarn hardhat etherscan-verify --network goerli

Run the tests

yarn test:locker
yarn test:staking
yarn test:token-launcher

Creating Diamond Implementation contract

Facets Names

Add the names of your facets to the facetsNames variable in the generateImplementation.ts file.

Run the following command:

yarn hardhat deploy --network goerli --tags DiamondImplementation