Skip to content

Commit

Permalink
Merge pull request #651 from public-awesome/humanalgorithm/copy-files…
Browse files Browse the repository at this point in the history
…-from-rekt

copy files in parallel for dydx airdrop
  • Loading branch information
humanalgorithm authored Jan 29, 2024
2 parents a654c78 + b139dc6 commit 9b045dd
Show file tree
Hide file tree
Showing 82 changed files with 2,509 additions and 123 deletions.
54 changes: 48 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ workflows:
- contract_open_edition_factory
- contract_open_edition_minter
- contract_whitelist
- sg-eth-airdrop
- rekt-airdrop
- dydx-airdrop
- test-suite
- package_sg_std
- package_sg_utils
Expand Down Expand Up @@ -424,10 +425,10 @@ jobs:
- target
key: cargocache-sg-utils-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}

sg-eth-airdrop:
rekt-airdrop:
docker:
- image: rust:1.73.0
working_directory: ~/project/contracts/sg-eth-airdrop
working_directory: ~/project/contracts/rekt-airdrop
steps:
- checkout:
path: ~/project
Expand All @@ -436,7 +437,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-sg-eth-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-rekt-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -458,7 +459,43 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-sg-eth-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-rekt-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}

dydx-airdrop:
docker:
- image: rust:1.73.0
working_directory: ~/project/contracts/dydx-airdrop
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-dydx-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
# - run:
# name: Ensure checked-in schemas are up-to-date
# command: |
# CHANGES_IN_REPO=$(git status --porcelain)
# if [[ -n "$CHANGES_IN_REPO" ]]; then
# echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
# git status && git --no-pager diff
# exit 1
# fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-dydx-airdrop-rust:1.73.0-{{ checksum "~/project/Cargo.lock" }}

lint:
docker:
Expand Down Expand Up @@ -528,7 +565,12 @@ jobs:
echo "Compiling `basename $C`..."
(cd $C && cargo build --release --lib --target wasm32-unknown-unknown --locked)
done
for C in ./contracts/sg-eth-airdrop/
for C in ./contracts/rekt-airdrop/
do
echo "Compiling `basename $C`..."
(cd $C && cargo build --release --lib --target wasm32-unknown-unknown --locked)
done
for C in ./contracts/dydx-airdrop/
do
echo "Compiling `basename $C`..."
(cd $C && cargo build --release --lib --target wasm32-unknown-unknown --locked)
Expand Down
108 changes: 72 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ open-edition-minter = { version = "3.5.0", path = "contracts/minters/open-editi
whitelist-immutable = { version = "3.5.0", path = "contracts/whitelists/whitelist-immutable" }
sg-whitelist-flex = { version = "3.5.0", path = "contracts/whitelists/whitelist-flex" }
ethereum-verify = { version = "3.5.0", path = "packages/ethereum-verify" }
sg-eth-airdrop = { version = "3.5.0", path = "contracts/sg-eth-airdrop" }
rekt-airdrop = { version = "3.5.0", path = "contracts/rekt-airdrop"}
dydx-airdrop = { version = "3.5.0", path = "contracts/dydx-airdrop"}
test-suite = { version = "3.5.0", path = "test-suite" }

semver = "1"
Expand Down Expand Up @@ -107,7 +108,11 @@ incremental = false
codegen-units = 1
incremental = false

[profile.release.package.sg-eth-airdrop]
[profile.release.package.rekt-airdrop]
codegen-units = 1
incremental = false

[profile.release.package.dydx-airdrop]
codegen-units = 1
incremental = false

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sg-eth-airdrop"
name = "dydx-airdrop"
authors = ["Michael Scotto <[email protected]>"]
description = "Stargaze Ethereum Airdrop"
description = "Stargaze dydx Airdrop"
version = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"contract_name": "sg-eth-airdrop",
"contract_name": "dydx-airdrop",
"contract_version": "3.5.0",
"idl_version": "1.0.0",
"instantiate": {
Expand Down
31 changes: 31 additions & 0 deletions contracts/dydx-airdrop/schema/raw/execute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"claim_airdrop"
],
"properties": {
"claim_airdrop": {
"type": "object",
"required": [
"eth_address",
"eth_sig"
],
"properties": {
"eth_address": {
"type": "string"
},
"eth_sig": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
53 changes: 53 additions & 0 deletions contracts/dydx-airdrop/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"addresses",
"admin",
"airdrop_amount",
"claim_msg_plaintext",
"minter_address",
"per_address_limit",
"whitelist_code_id"
],
"properties": {
"addresses": {
"type": "array",
"items": {
"type": "string"
}
},
"admin": {
"$ref": "#/definitions/Addr"
},
"airdrop_amount": {
"type": "integer",
"format": "uint128",
"minimum": 0.0
},
"claim_msg_plaintext": {
"type": "string"
},
"minter_address": {
"$ref": "#/definitions/Addr"
},
"per_address_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"whitelist_code_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"additionalProperties": false,
"definitions": {
"Addr": {
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
"type": "string"
}
}
}
Loading

0 comments on commit 9b045dd

Please sign in to comment.