diff --git a/cosmwasm/utils.js b/cosmwasm/utils.js index fdc39758..cbaf8400 100644 --- a/cosmwasm/utils.js +++ b/cosmwasm/utils.js @@ -43,7 +43,7 @@ const prepareWallet = async ({ mnemonic }) => await DirectSecp256k1HdWallet.from const prepareClient = async ({ axelar: { rpc, gasPrice } }, wallet) => await SigningCosmWasmClient.connectWithSigner(rpc, wallet, { gasPrice }); -const pascalToKebab = (str) => str.replace(/([A-Z])/g, (group) => `-${group.toLowerCase()}`).replace(/^-/, ''); +const pascalToSnake = (str) => str.replace(/([A-Z])/g, (group) => `_${group.toLowerCase()}`).replace(/^_/, ''); const isValidCosmosAddress = (str) => { try { @@ -61,7 +61,7 @@ const getSalt = (salt, contractName, chainName) => fromHex(getSaltFromKey(salt | const getLabel = ({ contractName, label }) => label || contractName; -const readWasmFile = ({ artifactPath, contractName }) => readFileSync(`${artifactPath}/${pascalToKebab(contractName)}.wasm`); +const readWasmFile = ({ artifactPath, contractName }) => readFileSync(`${artifactPath}/${pascalToSnake(contractName)}.wasm`); const initContractConfig = (config, { contractName, chainName }) => { config.axelar = config.axelar || {}; diff --git a/sui/deploy-contract.js b/sui/deploy-contract.js index 9a3d853a..1e261577 100644 --- a/sui/deploy-contract.js +++ b/sui/deploy-contract.js @@ -96,14 +96,16 @@ const supportedPackages = PACKAGE_DIRS.map((dir) => ({ */ async function postDeployRelayerDiscovery(published, keypair, client, config, chain, options) { - const [relayerDiscoveryObjectId, relayerDiscoveryObjectIdv0] = getObjectIdsByObjectTypes(published.publishTxn, [ + const [relayerDiscoveryObjectId, relayerDiscoveryObjectIdv0, ownerCap] = getObjectIdsByObjectTypes(published.publishTxn, [ `${published.packageId}::discovery::RelayerDiscovery`, `${published.packageId}::relayer_discovery_v0::RelayerDiscovery_v0`, + `${published.packageId}::owner_cap::OwnerCap`, ]); chain.contracts.RelayerDiscovery.objects = { RelayerDiscovery: relayerDiscoveryObjectId, RelayerDiscoveryv0: relayerDiscoveryObjectIdv0, + OwnerCap: ownerCap, }; } @@ -235,15 +237,22 @@ async function postDeployAxelarGateway(published, keypair, client, config, chain async function postDeployIts(published, keypair, client, config, chain, options) { const relayerDiscovery = chain.contracts.RelayerDiscovery?.objects?.RelayerDiscovery; - const [itsObjectId, itsv0ObjectId, ownerCapObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [ + const [itsObjectId, itsv0ObjectId, ownerCapObjectId, upgradeCapObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [ `${published.packageId}::its::ITS`, `${published.packageId}::its_v0::ITS_v0`, `${published.packageId}::owner_cap::OwnerCap`, + `${suiPackageAddress}::package::UpgradeCap`, ]); const channelId = await getItsChannelId(client, itsv0ObjectId); - chain.contracts.ITS.objects = { ITS: itsObjectId, ITSv0: itsv0ObjectId, ChannelId: channelId, OwnerCap: ownerCapObjectId }; + chain.contracts.ITS.objects = { + ITS: itsObjectId, + ITSv0: itsv0ObjectId, + ChannelId: channelId, + OwnerCap: ownerCapObjectId, + UpgradeCap: upgradeCapObjectId, + }; const tx = new Transaction(); tx.moveCall({ @@ -257,9 +266,12 @@ async function postDeployIts(published, keypair, client, config, chain, options) async function postDeploySquid(published, keypair, client, config, chain, options) { const relayerDiscovery = chain.contracts.RelayerDiscovery?.objects?.RelayerDiscovery; - const [squidObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [`${published.packageId}::squid::Squid`]); + const [squidObjectId, ownerCapObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [ + `${published.packageId}::squid::Squid`, + `${published.packageId}::owner_cap::OwnerCap`, + ]); const channelId = await getSquidChannelId(client, squidObjectId); - chain.contracts.Squid.objects = { Squid: squidObjectId, ChannelId: channelId }; + chain.contracts.Squid.objects = { Squid: squidObjectId, ChannelId: channelId, OwnerCap: ownerCapObjectId }; const tx = new Transaction(); tx.moveCall({