Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove stable token dependency, treasury module #12

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
401 changes: 295 additions & 106 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ This mono repository contains the source code for the smart contracts implementi

You can find information about the architecture, usage, and function of the smart contracts on the official Valkyrie Protocol documentation [site](https://docs.valkyrieprotocol.com).

### Dependencies
Valkyrie Protocol depends on Terraswap and uses its implementation of the CW20 token specification.

## Contracts
| Contract | Reference | Description |
| --------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
12 changes: 5 additions & 7 deletions contracts/campaign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ overflow-checks = true

[dependencies]
serde = { version = "1.0.126", default-features = false, features = ["derive"] }
schemars = { version = "0.8.3" }
cosmwasm-std = { version = "0.16.0" }
cw-storage-plus = { version = "0.8.1", features = ["iterator"] }
cw20 = { version = "0.8.1" }
schemars = { version = "0.8.10" }
cosmwasm-std = { version = "1.0.0" }
cw-storage-plus = { version = "0.11.0", features = ["iterator"] }
cw20 = { version = "0.11.0" }
valkyrie = { path = "../../packages/valkyrie", default-features = false, version = "1.0.8-beta.1" }
valkyrie-qualifier = { path = "../../packages/valkyrie_qualifier", default-features = false, version = "1.0.8-beta.1" }
protobuf = { version = "2", features = ["with-bytes"] }
terraswap = "2.4.0"

[dev-dependencies]
cosmwasm-schema = { version = "0.16.0" }
terra-cosmwasm = { version = "2.2.0" }
cosmwasm-schema = { version = "1.0.0" }
2 changes: 1 addition & 1 deletion contracts/campaign/proto/core_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ syntax = "proto3";
// MsgInstantiateContractResponse defines the Msg/InstantiateContract response type.
message MsgInstantiateContractResponse {
// ContractAddress is the bech32 address of the new contract instance.
string contract_address = 1;
string address = 1;
// Data contains base64-encoded bytes to returned from the contract
bytes data = 2;
}
Expand Down
41 changes: 37 additions & 4 deletions contracts/campaign/schema/actor_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,32 @@
"type": "object",
"required": [
"address",
"claimed_participation_reward_amount",
"claimed_referral_reward_amount",
"cumulative_participation_reward_amount",
"cumulative_referral_reward_amount",
"last_participated_at",
"participation_count",
"participation_reward_amount",
"participation_reward_amounts",
"participation_reward_last_distributed",
"referral_count",
"referral_reward_amount",
"referral_reward_amounts"
"referral_reward_amounts",
"referral_reward_last_distributed",
"unlocked_participation_reward_amount",
"unlocked_referral_reward_amount"
],
"properties": {
"address": {
"type": "string"
},
"claimed_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"claimed_referral_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"cumulative_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
Expand All @@ -41,18 +53,28 @@
"type": "array",
"items": [
{
"$ref": "#/definitions/Uint128"
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"$ref": "#/definitions/Uint128"
}
],
"maxItems": 2,
"minItems": 2
"maxItems": 3,
"minItems": 3
}
},
"participation_reward_last_distributed": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"referral_count": {
"type": "integer",
"format": "uint64",
Expand All @@ -79,11 +101,22 @@
"minItems": 2
}
},
"referral_reward_last_distributed": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"referrer_address": {
"type": [
"string",
"null"
]
},
"unlocked_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"unlocked_referral_reward_amount": {
"$ref": "#/definitions/Uint128"
}
},
"definitions": {
Expand Down
41 changes: 37 additions & 4 deletions contracts/campaign/schema/actors_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,32 @@
"type": "object",
"required": [
"address",
"claimed_participation_reward_amount",
"claimed_referral_reward_amount",
"cumulative_participation_reward_amount",
"cumulative_referral_reward_amount",
"last_participated_at",
"participation_count",
"participation_reward_amount",
"participation_reward_amounts",
"participation_reward_last_distributed",
"referral_count",
"referral_reward_amount",
"referral_reward_amounts"
"referral_reward_amounts",
"referral_reward_last_distributed",
"unlocked_participation_reward_amount",
"unlocked_referral_reward_amount"
],
"properties": {
"address": {
"type": "string"
},
"claimed_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"claimed_referral_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"cumulative_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
Expand All @@ -55,18 +67,28 @@
"type": "array",
"items": [
{
"$ref": "#/definitions/Uint128"
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"$ref": "#/definitions/Uint128"
}
],
"maxItems": 2,
"minItems": 2
"maxItems": 3,
"minItems": 3
}
},
"participation_reward_last_distributed": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"referral_count": {
"type": "integer",
"format": "uint64",
Expand All @@ -93,11 +115,22 @@
"minItems": 2
}
},
"referral_reward_last_distributed": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"referrer_address": {
"type": [
"string",
"null"
]
},
"unlocked_participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"unlocked_referral_reward_amount": {
"$ref": "#/definitions/Uint128"
}
}
},
Expand Down
34 changes: 24 additions & 10 deletions contracts/campaign/schema/campaign_config_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"required": [
"description",
"parameter_key",
"participation_reward_amount",
"participation_reward_denom",
"participation_reward_lock_period",
"participation_reward_distribution_schedule",
"referral_reward_amounts",
"referral_reward_lock_period",
"title",
Expand All @@ -20,16 +19,31 @@
"parameter_key": {
"type": "string"
},
"participation_reward_amount": {
"$ref": "#/definitions/Uint128"
},
"participation_reward_denom": {
"$ref": "#/definitions/Denom"
},
"participation_reward_lock_period": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"participation_reward_distribution_schedule": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"$ref": "#/definitions/Uint128"
}
],
"maxItems": 3,
"minItems": 3
}
},
"referral_reward_amounts": {
"type": "array",
Expand All @@ -51,7 +65,7 @@
},
"definitions": {
"Denom": {
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
12 changes: 10 additions & 2 deletions contracts/campaign/schema/campaign_config_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"governance",
"parameter_key",
"title",
"url"
"url",
"vp_burn_amount",
"vp_token"
],
"properties": {
"admin": {
Expand Down Expand Up @@ -72,11 +74,17 @@
},
"url": {
"type": "string"
},
"vp_burn_amount": {
"$ref": "#/definitions/Uint128"
},
"vp_token": {
"type": "string"
}
},
"definitions": {
"Denom": {
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
12 changes: 10 additions & 2 deletions contracts/campaign/schema/campaign_instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"deposit_amount",
"deposit_lock_period",
"governance",
"referral_reward_token"
"referral_reward_token",
"vp_burn_amount",
"vp_token"
],
"properties": {
"admin": {
Expand Down Expand Up @@ -60,6 +62,12 @@
},
"referral_reward_token": {
"type": "string"
},
"vp_burn_amount": {
"$ref": "#/definitions/Uint128"
},
"vp_token": {
"type": "string"
}
},
"definitions": {
Expand All @@ -68,7 +76,7 @@
"type": "string"
},
"Denom": {
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/campaign/schema/campaign_state_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"definitions": {
"Denom": {
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/campaign/schema/cw20_hook_msg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cw20HookMsg",
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/campaign/schema/distribute_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"definitions": {
"Denom": {
"anyOf": [
"oneOf": [
{
"type": "object",
"required": [
Expand Down
Loading