Skip to content

Commit

Permalink
added v2.6.0 contracts, and removed cosmos hub theta testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Nov 9, 2024
1 parent acb2873 commit 4712b28
Show file tree
Hide file tree
Showing 24 changed files with 721 additions and 161 deletions.
16 changes: 8 additions & 8 deletions apps/dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/dapp",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "AGPL-3.0-only",
"scripts": {
"postinstall": "cd ../../ && patch-package",
Expand All @@ -21,12 +21,12 @@
"ts:watch": "ts --watch"
},
"dependencies": {
"@dao-dao/i18n": "2.5.0-rc.3",
"@dao-dao/state": "2.5.0-rc.3",
"@dao-dao/stateful": "2.5.0-rc.3",
"@dao-dao/stateless": "2.5.0-rc.3",
"@dao-dao/types": "2.5.0-rc.3",
"@dao-dao/utils": "2.5.0-rc.3",
"@dao-dao/i18n": "2.6.0-rc.1",
"@dao-dao/state": "2.6.0-rc.1",
"@dao-dao/stateful": "2.6.0-rc.1",
"@dao-dao/stateless": "2.6.0-rc.1",
"@dao-dao/types": "2.6.0-rc.1",
"@dao-dao/utils": "2.6.0-rc.1",
"@fontsource/inter": "^4.5.7",
"@fontsource/jetbrains-mono": "^4.5.5",
"@keplr-wallet/common": "^0.11.49",
Expand All @@ -53,7 +53,7 @@
"sharp": "^0.31.1"
},
"devDependencies": {
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"@next/bundle-analyzer": "^14.1.0",
"@playwright/test": "^1.44.1",
"@sentry/cli": "^2.21.3",
Expand Down
16 changes: 8 additions & 8 deletions apps/sda/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/sda",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "AGPL-3.0-only",
"scripts": {
"postinstall": "cd ../../ && patch-package",
Expand All @@ -18,12 +18,12 @@
"ts:watch": "ts --watch"
},
"dependencies": {
"@dao-dao/i18n": "2.5.0-rc.3",
"@dao-dao/state": "2.5.0-rc.3",
"@dao-dao/stateful": "2.5.0-rc.3",
"@dao-dao/stateless": "2.5.0-rc.3",
"@dao-dao/types": "2.5.0-rc.3",
"@dao-dao/utils": "2.5.0-rc.3",
"@dao-dao/i18n": "2.6.0-rc.1",
"@dao-dao/state": "2.6.0-rc.1",
"@dao-dao/stateful": "2.6.0-rc.1",
"@dao-dao/stateless": "2.6.0-rc.1",
"@dao-dao/types": "2.6.0-rc.1",
"@dao-dao/utils": "2.6.0-rc.1",
"@fontsource/inter": "^4.5.7",
"@fontsource/jetbrains-mono": "^4.5.5",
"@keplr-wallet/common": "^0.11.49",
Expand All @@ -49,7 +49,7 @@
"sharp": "^0.31.1"
},
"devDependencies": {
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"@next/bundle-analyzer": "^12.1.0",
"@sentry/cli": "^2.21.3",
"@solana/web3.js": "^1.75.0",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "2.5.0-rc.3"
"version": "2.6.0-rc.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dao-dao-ui",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"workspaces": [
"apps/*",
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/config",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "BSD-3-Clause-Clear",
"scripts": {
"cwgen": "tsx ./scripts/cwgen.ts"
Expand Down
8 changes: 6 additions & 2 deletions packages/dispatch/config.toml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
### The mnemonic to use for signing transactions.
mnemonic = "abc def ghi"
[default]

### The directories to look in for compiled contracts.
contract_dirs = [
Expand All @@ -9,3 +8,8 @@ contract_dirs = [

### The path to the ansible indexer group_vars folder in the ops repo.
indexer_ansible_group_vars_path = "/Users/user/Developer/ops/ansible/group_vars"

### The mnemonics to use for signing transactions.
[mnemonics]

default = "abc def ghi"
10 changes: 5 additions & 5 deletions packages/dispatch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/dispatch",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "BSD-3-Clause-Clear",
"private": true,
"scripts": {
Expand All @@ -11,10 +11,10 @@
},
"devDependencies": {
"@confio/relayer": "^0.12.0",
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/state": "2.5.0-rc.3",
"@dao-dao/types": "2.5.0-rc.3",
"@dao-dao/utils": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"@dao-dao/state": "2.6.0-rc.1",
"@dao-dao/types": "2.6.0-rc.1",
"@dao-dao/utils": "2.6.0-rc.1",
"@types/proper-lockfile": "^4.1.4",
"chalk": "^4",
"commander": "^11.0.0",
Expand Down
41 changes: 37 additions & 4 deletions packages/dispatch/scripts/deploy/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ export const deploySets: DeploySet[] = [
contracts: ['cw1_whitelist', 'cw4_group'],
},

// the admin factory contract to deploy on all chains every time except Terra
// Classic since it doesn't support instantiate2
{
name: 'admin factory',
type: 'always',
contracts: ['cw_admin_factory'],
skipChainIds: [ChainId.TerraClassicMainnet],
},

// the core DAO contracts to deploy on all chains every time
{
name: 'core DAO stuff',
type: 'always',
contracts: [
'cw_admin_factory',
'cw_payroll_factory',
'cw_token_swap',
'dao_dao_core',
Expand Down Expand Up @@ -222,7 +230,12 @@ export const deploySets: DeploySet[] = [
{
name: 'token factory',
type: 'always',
contracts: ['cw_tokenfactory_issuer'],
contracts: [
{
file: 'cw_tokenfactory_issuer-osmosis',
alias: 'cw_tokenfactory_issuer',
},
],
chainIds: [
ChainId.JunoMainnet,
ChainId.JunoTestnet,
Expand Down Expand Up @@ -273,7 +286,6 @@ export const deploySets: DeploySet[] = [
ChainId.BitsongTestnet,

ChainId.CosmosHubMainnet,
ChainId.CosmosHubThetaTestnet,
ChainId.CosmosHubProviderTestnet,

ChainId.JunoMainnet,
Expand Down Expand Up @@ -330,7 +342,6 @@ export const chainIdToIndexerGroupVarsName: Record<string, string> = {
[ChainId.BitsongTestnet]: 'bitsong_testnet',
[ChainId.CosmosHubMainnet]: 'cosmosHub_mainnet',
[ChainId.CosmosHubProviderTestnet]: 'cosmosHubProvider_testnet',
[ChainId.CosmosHubThetaTestnet]: 'cosmosHubTheta_testnet',
[ChainId.JunoMainnet]: 'juno_mainnet',
[ChainId.JunoTestnet]: 'juno_testnet',
[ChainId.KujiraMainnet]: 'kujira_mainnet',
Expand All @@ -349,3 +360,25 @@ export const chainIdToIndexerGroupVarsName: Record<string, string> = {
[ChainId.TerraMainnet]: 'terra_mainnet',
[ChainId.TerraClassicMainnet]: 'terraClassic_mainnet',
}

/**
* Map chain ID to deployment argument overrides.
*/
export const chainIdToDeploymentArgs: Record<string, Record<string, any>> = {
[ChainId.StargazeMainnet]: {
authz: 'stars1565xc6aq0ycfx5zwusevpmwx6f5uzp93zuutfp',
},
[ChainId.KujiraMainnet]: {
mnemonic: 'df_operator',
authz: 'kujira1ss7avjjlzrmnp2m3thges80vetpq4nr8tjk20f0arweke8r840ss58v6yh',
restrictInstantiation: true,
instantiateAdminFactory: false,
},
[ChainId.OmniflixHubMainnet]: {
mnemonic: 'df_operator',
authz: 'omniflix1kr6t4gg33kfuc26rz4xxkv0ftlxq5j09pndcf9ndk450rrevgf8sy59urv',
},
[ChainId.BitsongTestnet]: {
mnemonic: 'bitsong_testnet',
},
}
66 changes: 52 additions & 14 deletions packages/dispatch/scripts/deploy/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import {

import { instantiateContract } from '../utils'
import { CodeIdConfig } from './CodeIdConfig'
import { DeploySetContract, deploySets } from './config'
import {
DeploySetContract,
chainIdToDeploymentArgs,
deploySets,
} from './config'

const { log } = console

Expand All @@ -50,16 +54,13 @@ try {
}

const {
mnemonic,
contract_dirs: contractDirs,
indexer_ansible_group_vars_path: indexerAnsibleGroupVarsPath,
default: {
contract_dirs: contractDirs,
indexer_ansible_group_vars_path: indexerAnsibleGroupVarsPath,
},
mnemonics,
} = config

if (!mnemonic) {
log(chalk.red('mnemonic not set'))
process.exit(1)
}

if (!indexerAnsibleGroupVarsPath) {
log(chalk.red('indexer_ansible_group_vars_path not set'))
process.exit(1)
Expand Down Expand Up @@ -90,16 +91,53 @@ program.option(
'-r, --restrict-instantiation',
'restrict instantiation to only the uploader; this must be used on some chains to upload contracts, like Kujira'
)
program.option(
'-p, --mnemonic <name>',
'use this configured mnemonic name for signing transactions',
'default'
)
program.option(
'--no-instantiate-admin-factory',
'do not instantiate the admin factory'
)

program.parse(process.argv)
const {
let {
chain: chainId,
mode,
version,
authz,
restrictInstantiation,
mnemonic: mnemonicName,
instantiateAdminFactory,
} = program.opts()

// Add deployment arguments if they exist.
const deploymentArgs = chainIdToDeploymentArgs[chainId]
if (deploymentArgs) {
if (deploymentArgs.mode !== undefined) {
mode = deploymentArgs.mode
}
if (deploymentArgs.authz !== undefined) {
authz = deploymentArgs.authz
}
if (deploymentArgs.restrictInstantiation !== undefined) {
restrictInstantiation = deploymentArgs.restrictInstantiation
}
if (deploymentArgs.mnemonic !== undefined) {
mnemonicName = deploymentArgs.mnemonic
}
if (deploymentArgs.instantiateAdminFactory !== undefined) {
instantiateAdminFactory = deploymentArgs.instantiateAdminFactory
}
}

const mnemonic = mnemonics[mnemonicName]
if (!mnemonic) {
log(chalk.red(`Mnemonic with name "${mnemonicName}" not found in config.`))
process.exit(1)
}

if (!Object.values(Mode).includes(mode)) {
log(
chalk.red('Invalid mode. Must be one of: ' + Object.values(Mode).join(', '))
Expand Down Expand Up @@ -218,7 +256,7 @@ const main = async () => {

// Poll for TX.
let events
let tries = 15
let tries = 50
while (tries > 0) {
try {
events = (await client.getTx(transactionHash))?.events
Expand All @@ -228,7 +266,7 @@ const main = async () => {
} catch {}

tries--
await new Promise((resolve) => setTimeout(resolve, 200))
await new Promise((resolve) => setTimeout(resolve, 300))
}

if (!events) {
Expand Down Expand Up @@ -476,7 +514,7 @@ const main = async () => {
}

const adminFactoryAddress =
cwAdminFactoryCodeId !== null
instantiateAdminFactory && cwAdminFactoryCodeId !== null
? await instantiateContract({
client,
sender,
Expand Down Expand Up @@ -512,7 +550,7 @@ const main = async () => {
govProp: `https://${explorerUrlDomain}/${chainName}/gov/REPLACE`,
wallet: `https://${explorerUrlDomain}/${chainName}/account/REPLACE`,
},
latestVersion: ContractVersion.Unknown,
latestVersion: version || ContractVersion.Unknown,
}

log(JSON.stringify(config, null, 2))
Expand Down
6 changes: 3 additions & 3 deletions packages/email/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/email",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "BSD-3-Clause-Clear",
"scripts": {
"format": "eslint . --fix",
Expand All @@ -10,8 +10,8 @@
},
"devDependencies": {
"@aws-sdk/client-ses": "^3.592.0",
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/types": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"@dao-dao/types": "2.6.0-rc.1",
"@react-email/components": "^0.0.7",
"@react-email/render": "0.0.7",
"commander": "^11.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/i18n",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "BSD-3-Clause-Clear",
"scripts": {
"format": "eslint . --fix",
Expand All @@ -17,7 +17,7 @@
"react-i18next": "^11.0.0"
},
"devDependencies": {
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"eslint-plugin-i18n-json": "^3.1.0",
"i18n-unused": "^0.10.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/math/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dao-dao/math",
"version": "2.5.0-rc.3",
"version": "2.6.0-rc.1",
"license": "BSD-3-Clause-Clear",
"scripts": {
"format": "eslint . --fix",
Expand All @@ -11,7 +11,7 @@
"bignumber.js": "^9.1.2"
},
"devDependencies": {
"@dao-dao/config": "2.5.0-rc.3",
"@dao-dao/config": "2.6.0-rc.1",
"jest": "^29.1.1",
"typescript": "5.3.3"
},
Expand Down
Loading

0 comments on commit 4712b28

Please sign in to comment.