Skip to content

Commit

Permalink
update cw plus contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
calvwang9 committed Sep 7, 2023
1 parent 408c523 commit f6ec529
Show file tree
Hide file tree
Showing 34 changed files with 3,932 additions and 894 deletions.
2 changes: 1 addition & 1 deletion packages-ts/gauntlet-cosmos-contracts/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const enum CATEGORIES {
}

export const DEFAULT_RELEASE_VERSION = 'local'
export const DEFAULT_CWPLUS_VERSION = 'v0.16.0'
export const DEFAULT_CWPLUS_VERSION = 'v1.1.0'

export const ORACLES_MAX_LENGTH = 31

Expand Down
9 changes: 9 additions & 0 deletions packages-ts/gauntlet-cosmos-contracts/src/lib/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ export abstract class Contract {
const abi = possibleContractPaths
.filter((path) => existsSync(`${path}/${this.dirName}/schema`))
.map((contractPath) => {
if (existsSync(path.join(contractPath, `./${this.dirName}/schema/${this.dirName.replace('_', '-')}`))) {
const abi = io.readJSON(path.join(contractPath, `./${this.dirName}/schema/${this.dirName.replace('_', '-')}`))
return {
execute: abi.execute,
query: abi.query,
instantiate: abi.instantiate,
}
}

const toPath = (type) => path.join(contractPath, `./${this.dirName}/schema/raw/${type}`)
return {
execute: io.readJSON(toPath('execute')),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "cw20-base",
"contract_version": "0.16.0",
"contract_version": "1.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down Expand Up @@ -54,7 +54,7 @@
"additionalProperties": false,
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"Cw20Coin": {
Expand Down Expand Up @@ -543,7 +543,7 @@
],
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"EmbeddedLogo": {
Expand Down Expand Up @@ -1228,7 +1228,7 @@
"additionalProperties": false,
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
}
}
Expand Down Expand Up @@ -1283,12 +1283,6 @@
"LogoInfo": {
"description": "This is used to display logo info, provide a link or inform there is one that can be downloaded from the blockchain itself",
"oneOf": [
{
"type": "string",
"enum": [
"embedded"
]
},
{
"description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.",
"type": "object",
Expand All @@ -1301,6 +1295,13 @@
}
},
"additionalProperties": false
},
{
"description": "There is an embedded logo on the chain, make another call to download it.",
"type": "string",
"enum": [
"embedded"
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
"spender": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"anyOf": [
"oneOf": [
{
"description": "AtHeight will expire when `env.block.height` >= height",
"type": "object",
Expand Down Expand Up @@ -72,7 +73,8 @@
],
"properties": {
"never": {
"type": "object"
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"definitions": {
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"anyOf": [
"oneOf": [
{
"description": "AtHeight will expire when `env.block.height` >= height",
"type": "object",
Expand Down Expand Up @@ -54,7 +54,8 @@
],
"properties": {
"never": {
"type": "object"
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false,
"definitions": {
"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); ```",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "DownloadLogoResponse",
"description": "When we download an embedded logo, we get this response type. We expect a SPA to be able to accept this info and display it.",
"type": "object",
"required": [
"data",
"mime_type"
],
"properties": {
"data": {
"$ref": "#/definitions/Binary"
},
"mime_type": {
"type": "string"
}
},
"additionalProperties": false,
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cw20ExecuteMsg",
"anyOf": [
"oneOf": [
{
"description": "Transfer is a base message to move tokens to another account without triggering actions",
"type": "object",
Expand All @@ -22,7 +22,8 @@
"recipient": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -43,7 +44,8 @@
"amount": {
"$ref": "#/definitions/Uint128"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -72,7 +74,8 @@
"msg": {
"$ref": "#/definitions/Binary"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -107,7 +110,8 @@
"spender": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -142,7 +146,8 @@
"spender": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -171,7 +176,8 @@
"recipient": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -204,7 +210,8 @@
"owner": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -229,7 +236,8 @@
"owner": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -254,7 +262,30 @@
"recipient": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Only with the \"mintable\" extension. The current minter may set a new minter. Setting the minter to None will remove the token's minter forever.",
"type": "object",
"required": [
"update_minter"
],
"properties": {
"update_minter": {
"type": "object",
"properties": {
"new_minter": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -290,7 +321,8 @@
"null"
]
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -311,12 +343,12 @@
],
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"EmbeddedLogo": {
"description": "This is used to store the logo on the blockchain in an accepted format. Enforce maximum size of 5KB on all variants.",
"anyOf": [
"oneOf": [
{
"description": "Store the Logo as an SVG file. The content must conform to the spec at https://en.wikipedia.org/wiki/Scalable_Vector_Graphics (The contract should do some light-weight sanity-check validation)",
"type": "object",
Expand Down Expand Up @@ -347,7 +379,7 @@
},
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"anyOf": [
"oneOf": [
{
"description": "AtHeight will expire when `env.block.height` >= height",
"type": "object",
Expand Down Expand Up @@ -384,7 +416,8 @@
],
"properties": {
"never": {
"type": "object"
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
Expand All @@ -393,7 +426,7 @@
},
"Logo": {
"description": "This is used for uploading logo data, or setting it in InstantiateData",
"anyOf": [
"oneOf": [
{
"description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.",
"type": "object",
Expand Down
Loading

0 comments on commit f6ec529

Please sign in to comment.