Skip to content

Commit

Permalink
Merge pull request #652 from public-awesome/serkan/dydx-airdrop-updates
Browse files Browse the repository at this point in the history
dYdX Airdrop updates
  • Loading branch information
jhernandezb authored Apr 3, 2024
2 parents 290761e + 5f1ed3e commit 4744ccb
Show file tree
Hide file tree
Showing 35 changed files with 1,860 additions and 525 deletions.
369 changes: 316 additions & 53 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"contracts/factories/*",
"contracts/minters/*",
"contracts/whitelists/*",
"contracts/dydx-airdrop",
"test-suite/",
"e2e",
]
Expand Down Expand Up @@ -60,7 +61,10 @@ open-edition-factory = { version = "3.5.0", path = "contracts/factories/open-edi
open-edition-minter = { version = "3.5.0", path = "contracts/minters/open-edition-minter" }
whitelist-immutable = { version = "3.5.0", path = "contracts/whitelists/whitelist-immutable" }
whitelist-immutable-flex = { version = "3.5.0", path = "contracts/whitelists/whitelist-immutable-flex" }
whitelist-updatable = "0.12.0"
whitelist-updatable-flatrate = {git = "https://github.com/public-awesome/names.git", branch = "dYdX-airdrop"}
sg-whitelist-flex = { version = "3.5.0", path = "contracts/whitelists/whitelist-flex" }
sg721-name = "1.2.5"
ethereum-verify = { version = "3.5.0", path = "packages/ethereum-verify" }
rekt-airdrop = { version = "3.5.0", path = "contracts/rekt-airdrop"}
dydx-airdrop = { version = "3.5.0", path = "contracts/dydx-airdrop"}
Expand Down
10 changes: 7 additions & 3 deletions contracts/dydx-airdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ cw2 = { workspace = true }
ethereum-verify = { workspace = true }
hex = "0.4"
rust_decimal = { version = "1.14.3" }
sg-whitelist = { workspace = true }
cw721 = { workspace = true }
sg721-base = { workspace = true, features = ["library"] }
sg721-name = { workspace = true, features = ["library"] }
sg-whitelist-flex = { workspace = true, features = ["library"] }
sg1 = { workspace = true }
sha2 = { workspace = true }
sha3 = "0.10"
Expand All @@ -43,7 +46,9 @@ serde = { workspace = true }
sg-std = { workspace = true }
thiserror = { workspace = true }
vending-minter = { workspace = true, features = ["library"] }
whitelist-immutable = { workspace = true, features = ["library"] }
whitelist-immutable-flex = { workspace = true, features = ["library"] }
whitelist-updatable = { workspace = true, features = ["library"] }
whitelist-updatable-flatrate = { workspace = true, features = ["library"] }

[dev-dependencies]
async-std = "1.12.0"
Expand All @@ -53,7 +58,6 @@ eyre = "0.6"
rlp = "0.5"
sg2 = { workspace = true }
vending-factory = { workspace = true }
sg721-base = { workspace = true }
cw-multi-test = { workspace = true }
sg-multi-test = { workspace = true }
anyhow = "1.0.57"
153 changes: 136 additions & 17 deletions contracts/dydx-airdrop/schema/dydx-airdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,47 @@
"title": "InstantiateMsg",
"type": "object",
"required": [
"addresses",
"admin",
"airdrop_amount",
"airdrop_count_limit",
"claim_msg_plaintext",
"members",
"minter_address",
"per_address_limit",
"name_collection_address",
"name_discount_wl_address",
"whitelist_code_id"
],
"properties": {
"addresses": {
"type": "array",
"items": {
"type": "string"
}
},
"admin": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"airdrop_amount": {
"type": "integer",
"format": "uint128",
"minimum": 0.0
},
"airdrop_count_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"claim_msg_plaintext": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"$ref": "#/definitions/Member"
}
},
"minter_address": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"per_address_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"name_collection_address": {
"type": "string"
},
"name_discount_wl_address": {
"type": "string"
},
"whitelist_code_id": {
"type": "integer",
Expand All @@ -49,16 +57,55 @@
},
"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"
"Member": {
"type": "object",
"required": [
"address",
"mint_count"
],
"properties": {
"address": {
"type": "string"
},
"mint_count": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
}
}
},
"execute": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"register"
],
"properties": {
"register": {
"type": "object",
"required": [
"eth_address",
"eth_sig"
],
"properties": {
"eth_address": {
"type": "string"
},
"eth_sig": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -123,6 +170,61 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"is_registered"
],
"properties": {
"is_registered": {
"type": "object",
"required": [
"eth_address"
],
"properties": {
"eth_address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"has_claimed"
],
"properties": {
"has_claimed": {
"type": "object",
"required": [
"eth_address"
],
"properties": {
"eth_address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_airdrop_count"
],
"properties": {
"get_airdrop_count": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
Expand All @@ -134,11 +236,28 @@
"title": "Boolean",
"type": "boolean"
},
"get_airdrop_count": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "uint32",
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"get_minter": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "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"
},
"has_claimed": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Boolean",
"type": "boolean"
},
"is_registered": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Boolean",
"type": "boolean"
}
}
}
25 changes: 25 additions & 0 deletions contracts/dydx-airdrop/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"register"
],
"properties": {
"register": {
"type": "object",
"required": [
"eth_address",
"eth_sig"
],
"properties": {
"eth_address": {
"type": "string"
},
"eth_sig": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down
56 changes: 39 additions & 17 deletions contracts/dydx-airdrop/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,47 @@
"title": "InstantiateMsg",
"type": "object",
"required": [
"addresses",
"admin",
"airdrop_amount",
"airdrop_count_limit",
"claim_msg_plaintext",
"members",
"minter_address",
"per_address_limit",
"name_collection_address",
"name_discount_wl_address",
"whitelist_code_id"
],
"properties": {
"addresses": {
"type": "array",
"items": {
"type": "string"
}
},
"admin": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"airdrop_amount": {
"type": "integer",
"format": "uint128",
"minimum": 0.0
},
"airdrop_count_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"claim_msg_plaintext": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"$ref": "#/definitions/Member"
}
},
"minter_address": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"per_address_limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"name_collection_address": {
"type": "string"
},
"name_discount_wl_address": {
"type": "string"
},
"whitelist_code_id": {
"type": "integer",
Expand All @@ -45,9 +53,23 @@
},
"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"
"Member": {
"type": "object",
"required": [
"address",
"mint_count"
],
"properties": {
"address": {
"type": "string"
},
"mint_count": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
}
}
}
Loading

0 comments on commit 4744ccb

Please sign in to comment.