Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: 2.CW20 factory token smart contract
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Apr 19, 2022
0 parents commit fdba3c8
Show file tree
Hide file tree
Showing 87 changed files with 85,649 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/node_modules/
30 changes: 30 additions & 0 deletions config.terrain.json
@@ -0,0 +1,30 @@
{
"_global": {
"_base": {
"instantiation": {
"instantiateMsg": {
"stable_denom" : "uusd",
"token_contract_code_id" : 82
}
}
}
},
"mainnet": {
"_connection": {
"chainID": "columbus-5",
"URL": "https://lcd.terra.dev"
}
},
"testnet": {
"_connection": {
"chainID": "bombay-12",
"URL": "https://bombay-lcd.terra.dev"
}
},
"localterra": {
"_connection": {
"chainID": "localterra",
"URL": "http://localhost:3060"
}
}
}
4 changes: 4 additions & 0 deletions contracts/cw20-factory-token/.cargo/config
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
61 changes: 61 additions & 0 deletions contracts/cw20-factory-token/.circleci/config.yml
@@ -0,0 +1,61 @@
version: 2.1

executors:
builder:
docker:
- image: buildpack-deps:trusty

jobs:
docker-image:
executor: builder
steps:
- checkout
- setup_remote_docker
docker_layer_caching: true
- run:
name: Build Docker artifact
command: docker build --pull -t "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" .
- run:
name: Push application Docker image to docker hub
command: |
if [ "${CIRCLE_BRANCH}" = "master" ]; then
docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" cosmwasm/cw-gitpod-base:latest
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
docker push cosmwasm/cw-gitpod-base:latest
docker logout
fi
docker-tagged:
executor: builder
steps:
- checkout
- setup_remote_docker
docker_layer_caching: true
- run:
name: Push application Docker image to docker hub
command: |
docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" "cosmwasm/cw-gitpod-base:${CIRCLE_TAG}"
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
docker push
docker logout
workflows:
version: 2
test-suite:
jobs:
# this is now a slow process... let's only run on master
- docker-image:
filters:
branches:
only:
- master
- docker-tagged:
filters:
tags:
only:
- /^v.*/
branches:
ignore:
- /.*/
requires:
- docker-image
11 changes: 11 additions & 0 deletions contracts/cw20-factory-token/.editorconfig
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.rs]
indent_size = 4
74 changes: 74 additions & 0 deletions contracts/cw20-factory-token/.github/workflows/Basic.yml
@@ -0,0 +1,74 @@
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml

on: [push, pull_request]

name: Basic

jobs:

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
target: wasm32-unknown-unknown
override: true

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked
env:
RUST_BACKTRACE: 1

- name: Compile WASM contract
uses: actions-rs/cargo@v1
with:
command: wasm
args: --locked
env:
RUSTFLAGS: "-C link-arg=-s"

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

# TODO: we should check
# CHANGES_IN_REPO=$(git status --porcelain)
# after this, but I don't know how
- name: Generate Schema
uses: actions-rs/cargo@v1
with:
command: schema
args: --locked
15 changes: 15 additions & 0 deletions contracts/cw20-factory-token/.gitignore
@@ -0,0 +1,15 @@
# Build results
/target

# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327)
.cargo-ok

# Text file backups
**/*.rs.bk

# macOS
.DS_Store

# IDEs
*.iml
.idea
17 changes: 17 additions & 0 deletions contracts/cw20-factory-token/.gitpod.Dockerfile
@@ -0,0 +1,17 @@
### wasmd ###
FROM cosmwasm/wasmd:v0.18.0 as wasmd

### rust-optimizer ###
FROM cosmwasm/rust-optimizer:0.11.5 as rust-optimizer

FROM gitpod/workspace-full:latest

COPY --from=wasmd /usr/bin/wasmd /usr/local/bin/wasmd
COPY --from=wasmd /opt/* /opt/

RUN sudo apt-get update \
&& sudo apt-get install -y jq \
&& sudo rm -rf /var/lib/apt/lists/*

RUN rustup update stable \
&& rustup target add wasm32-unknown-unknown
10 changes: 10 additions & 0 deletions contracts/cw20-factory-token/.gitpod.yml
@@ -0,0 +1,10 @@
image: cosmwasm/cw-gitpod-base:v0.16

vscode:
extensions:
- rust-lang.rust

tasks:
- name: Dependencies & Build
init: |
cargo build

0 comments on commit fdba3c8

Please sign in to comment.