Skip to content

Commit

Permalink
Merge pull request #6 from comdex-official/audit_fix
Browse files Browse the repository at this point in the history
Audit fix
  • Loading branch information
dheerajkd30 authored Sep 11, 2022
2 parents 6a784dd + cd4423b commit f3acd34
Show file tree
Hide file tree
Showing 10 changed files with 1,311 additions and 658 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "locking-contract"
version = "0.1.0"
authors = ["comdex}"]
authors = ["Comdex"]
edition = "2018"

exclude = [
Expand Down Expand Up @@ -50,7 +50,8 @@ thiserror = { version = "1.0.31" }
cw721-base= { path = "packages/cw721-base"}
comdex-bindings= { path = "packages/bindings"}
cw4 = "0.14.0"

cw-utils = "0.14.0"
cw-controllers = "0.14.0"

[dev-dependencies]
cosmwasm-schema = "1.0.0"
Expand Down
28 changes: 18 additions & 10 deletions schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
{
"type": "object",
"required": [
"emmission"
"emission"
],
"properties": {
"emmission": {
"emission": {
"type": "object",
"required": [
"proposal_id"
Expand All @@ -139,15 +139,9 @@
"rebase": {
"type": "object",
"required": [
"app_id",
"proposal_id"
],
"properties": {
"app_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"proposal_id": {
"type": "integer",
"format": "uint64",
Expand Down Expand Up @@ -178,6 +172,16 @@
},
"locking_period": {
"$ref": "#/definitions/LockingPeriod"
},
"recipient": {
"anyOf": [
{
"$ref": "#/definitions/Addr"
},
{
"type": "null"
}
]
}
}
}
Expand Down Expand Up @@ -215,7 +219,7 @@
"required": [
"denom",
"locking_period",
"recipent"
"recipient"
],
"properties": {
"denom": {
Expand All @@ -224,7 +228,7 @@
"locking_period": {
"$ref": "#/definitions/LockingPeriod"
},
"recipent": {
"recipient": {
"type": "string"
}
}
Expand Down Expand Up @@ -256,6 +260,10 @@
}
],
"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"
},
"LockingPeriod": {
"type": "string",
"enum": [
Expand Down
12 changes: 10 additions & 2 deletions schema/instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"emission",
"foundation_addr",
"foundation_percentage",
"min_lock_amount",
"surplus_asset_id",
"t1",
"t2",
Expand All @@ -31,6 +32,9 @@
"foundation_percentage": {
"$ref": "#/definitions/Decimal"
},
"min_lock_amount": {
"$ref": "#/definitions/Uint128"
},
"surplus_asset_id": {
"type": "integer",
"format": "uint64",
Expand Down Expand Up @@ -71,7 +75,7 @@
"required": [
"app_id",
"distributed_rewards",
"emmission_rate",
"emission_rate",
"rewards_pending",
"total_rewards"
],
Expand All @@ -86,7 +90,7 @@
"format": "uint128",
"minimum": 0.0
},
"emmission_rate": {
"emission_rate": {
"$ref": "#/definitions/Decimal"
},
"rewards_pending": {
Expand Down Expand Up @@ -117,6 +121,10 @@
"$ref": "#/definitions/Decimal"
}
}
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
}
26 changes: 26 additions & 0 deletions schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,32 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"user_proposal_all_up"
],
"properties": {
"user_proposal_all_up": {
"type": "object",
"required": [
"address",
"proposal_id"
],
"properties": {
"address": {
"$ref": "#/definitions/Addr"
},
"proposal_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
},
"additionalProperties": false
}
],
"definitions": {
Expand Down
8 changes: 8 additions & 0 deletions schema/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"required": [
"foundation_addr",
"foundation_percentage",
"min_lock_amount",
"num_tokens",
"surplus_asset_id",
"t1",
Expand All @@ -25,6 +26,9 @@
"foundation_percentage": {
"$ref": "#/definitions/Decimal"
},
"min_lock_amount": {
"$ref": "#/definitions/Uint128"
},
"num_tokens": {
"type": "integer",
"format": "uint64",
Expand Down Expand Up @@ -81,6 +85,10 @@
"$ref": "#/definitions/Decimal"
}
}
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
}
Loading

0 comments on commit f3acd34

Please sign in to comment.