Skip to content

Commit

Permalink
- fixed typos
Browse files Browse the repository at this point in the history
- added readme.md
- removed github job to run e2e tests since they just instantiate the contracts
  • Loading branch information
dusan-maksimovic committed Dec 3, 2024
1 parent 68e5772 commit 066d078
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy contracts on Neutron testnet
name: Deploy latest contracts

on:
push:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ on:
- Cargo.toml
- Cargo.lock
- contracts/**
- packages/interface/**
- test/e2e/**
- artifacts/**
pull_request:
paths:
- .github/workflows/tests.yml
- Cargo.toml
- Cargo.lock
- contracts/**
- packages/interface/**
- test/e2e/**
- artifacts/**

env:
Expand All @@ -31,11 +27,3 @@ jobs:
- uses: actions/checkout@v4
- name: Unit tests
run: make test-unit
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: E2E tests
env:
E2E_TESTS_MNEMONIC: ${{ secrets.E2E_TESTS_MNEMONIC }}
run: make test-e2e
11 changes: 11 additions & 0 deletions tools/deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## The Purpose

This directory contains a set of shell scripts and JSON configuration files that allow us to easily store, instantiate and prepare our smart contracts for testing.
These scripts are used in two places:
1. In the GitHub [workflow](./../../.github/workflows/deploy-latest-contracts.yml) that will store, instantiate and populate the smart contracts on the Neutron testnet each time a PR is merged into the main branch.
2. To manually deploy contracts on the Neutron mainnet.

### Shell scripts
- `store_instantiate.sh` sends transactions to store the codes from the `artifacts` directory to the specified blockchain. Then it uses stored codes to instantiate Hydro and Tribute smart contracts. It relies on a JSON configuration file that is passed to it. It populates and exports two environment variables: `HYDRO_CONTRACT_ADDRESS` and `TRIBUTE_CONTRACT_ADDRESS`.
- `populate_contracts.sh` sends transactions to create proposals in the Hydro smart contract, and to add tributes for those proposals in the Tribute smart contract. It relies on `HYDRO_CONTRACT_ADDRESS` and `TRIBUTE_CONTRACT_ADDRESS` being previously set by the `store_instantiate.sh` script.
- `setup_on_mainnet.sh` executes previous two scripts by providing `config_mainnet.json` configuration that will result in smart contracts being set up on the Neutron mainnet. Prerequisite for running this script is to have the `neutrond` binary in your `PATH` and to import mnemonic that has enough NTRN tokens on the Neutron mainnet. If this mnemonic is for a different address than the one in `config_mainnet.json` file, then the configuration file needs to be adjusted as well.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -eux

source tools/deployment/store_instantiate.sh "tools/deployment/config_mainet.json" false
source tools/deployment/populate_contracts.sh "tools/deployment/config_mainet.json"
source tools/deployment/store_instantiate.sh "tools/deployment/config_mainnet.json" false
source tools/deployment/populate_contracts.sh "tools/deployment/config_mainnet.json"
2 changes: 1 addition & 1 deletion tools/deployment/store_instantiate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TX_FLAG="--gas auto --gas-adjustment 1.3"
NEUTRON_NODE_FLAG="--node $NEUTRON_NODE"
NEUTRON_TX_FLAGS="$TX_FLAG --gas-prices 0.0053untrn --chain-id $NEUTRON_CHAIN_ID $NEUTRON_NODE_FLAG $KEYRING_TEST_FLAG -y"

MAINET_ROUND_LENGTH="2628000000000000" # 365 / 12
MAINNET_ROUND_LENGTH="2628000000000000" # 365 / 12
ROUND_END_TEST_ROUND_LENGTH="172800000000000" # 2 days

CURRENT_TIME_NO_MINS_AND_SECS=$(date -d "$(date +"%Y-%m-%d %H:00:00")" +"%s000000000")
Expand Down

0 comments on commit 066d078

Please sign in to comment.