From 7f6cee4579e85e6eceb5510d774585d95293f211 Mon Sep 17 00:00:00 2001 From: Foivos Date: Wed, 5 Jun 2024 17:30:16 +0300 Subject: [PATCH 01/11] saving progress --- move/abi/Move.lock | 6 +- move/abi/Move.toml | 3 +- move/axelar/Move.lock | 27 +++++++ move/axelar_gateway/Move.lock | 6 +- move/axelar_gateway/Move.toml | 3 +- move/axelar_gateway/info.json | 1 - move/axelar_gateway/sources/auth.move | 2 +- move/test/Move.lock | 6 +- move/test/Move.toml | 3 +- move/test/sources/test/test.move | 4 + scripts/publish-package.js | 63 +--------------- scripts/test.js | 76 +++++++++++++++++++ scripts/tx-builder.js | 69 +++++++++++++++++ scripts/utils.js | 102 +++++++------------------- 14 files changed, 223 insertions(+), 148 deletions(-) create mode 100644 move/axelar/Move.lock create mode 100644 scripts/test.js create mode 100644 scripts/tx-builder.js diff --git a/move/abi/Move.lock b/move/abi/Move.lock index 285c6b4a..d50f85dc 100644 --- a/move/abi/Move.lock +++ b/move/abi/Move.lock @@ -2,7 +2,7 @@ [move] version = 2 -manifest_digest = "7DED727D47EB51E5059409B19CC373C6D9AF249D837E9153E7368F3898025E41" +manifest_digest = "89B38FFD4D0D8B2DCFE440924446CCF3A347EA904B2657C9CA229BD7BB881131" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -21,6 +21,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" +compiler-version = "1.22.0" +edition = "legacy" flavor = "sui" diff --git a/move/abi/Move.toml b/move/abi/Move.toml index 7eb23213..6d7ecf1e 100644 --- a/move/abi/Move.toml +++ b/move/abi/Move.toml @@ -1,10 +1,11 @@ [package] name = "Abi" version = "0.1.0" +published-at = "0x41fb7e9c9d8851ecbfd4b89c910c0465de0cd0cf757c4bb261a8a6019ea33390" edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" } [addresses] -abi = "0x103" +abi = "0x0" diff --git a/move/axelar/Move.lock b/move/axelar/Move.lock new file mode 100644 index 00000000..875170d6 --- /dev/null +++ b/move/axelar/Move.lock @@ -0,0 +1,27 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 0 +manifest_digest = "8B923BAABABD7F78C5ED5E16715CC628AD0DF9E7AF28490F9A625421CE9E384A" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.22.0" +edition = "legacy" +flavor = "sui" diff --git a/move/axelar_gateway/Move.lock b/move/axelar_gateway/Move.lock index 4c88b1b8..281d8e01 100644 --- a/move/axelar_gateway/Move.lock +++ b/move/axelar_gateway/Move.lock @@ -2,7 +2,7 @@ [move] version = 2 -manifest_digest = "11FAF5CFE0A4A2EBCD5E370FAD144FFF14243A85492B718A2B26A15CF7F0B571" +manifest_digest = "10303CE6C59BAA2CE814E3D11BACC8CB24BE0F8D66753B02190E291CA40F0D39" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -21,6 +21,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" +compiler-version = "1.22.0" +edition = "legacy" flavor = "sui" diff --git a/move/axelar_gateway/Move.toml b/move/axelar_gateway/Move.toml index 59b0a66f..235f55b2 100644 --- a/move/axelar_gateway/Move.toml +++ b/move/axelar_gateway/Move.toml @@ -1,11 +1,12 @@ [package] name = "AxelarGateway" version = "0.1.0" +published-at = "0x2abacf10c39c44760ad2afcfbdf7bc25054d3bd425c520ac770e688fdb74dffd" edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" } [addresses] -axelar_gateway = "0x100" +axelar_gateway = "0x2abacf10c39c44760ad2afcfbdf7bc25054d3bd425c520ac770e688fdb74dffd" clock = "0x6" diff --git a/move/axelar_gateway/info.json b/move/axelar_gateway/info.json index 9cb0d05d..2d9bb195 100644 --- a/move/axelar_gateway/info.json +++ b/move/axelar_gateway/info.json @@ -1,6 +1,5 @@ { "singletons": [ - "gateway::Gateway", "discovery::RelayerDiscovery" ] } \ No newline at end of file diff --git a/move/axelar_gateway/sources/auth.move b/move/axelar_gateway/sources/auth.move index 36a4d247..c0ca7bb0 100644 --- a/move/axelar_gateway/sources/auth.move +++ b/move/axelar_gateway/sources/auth.move @@ -104,7 +104,7 @@ module axelar_gateway::auth { let current_epoch = self.epoch; let is_latest_signers = current_epoch == signers_epoch; - assert!(signers_epoch == 0 || (current_epoch - signers_epoch) >= PREVIOUS_KEY_RETENTION, EInvalidEpoch); + assert!(signers_epoch == 0 || (current_epoch - signers_epoch) <= PREVIOUS_KEY_RETENTION, EInvalidEpoch); let message = MessageToSign { domain_separator: self.domain_separator, diff --git a/move/test/Move.lock b/move/test/Move.lock index 5afaa68d..12a46226 100644 --- a/move/test/Move.lock +++ b/move/test/Move.lock @@ -2,7 +2,7 @@ [move] version = 2 -manifest_digest = "CF736E0717CB61683E6D638E781AA77454AE00BCA196A7FD23E4ACDBD78C0A5A" +manifest_digest = "6DF02196C888A850522C2336E4F8FF37DA00BCBB2240DEBF2500B46D2358E034" deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600" dependencies = [ { name = "AxelarGateway" }, @@ -30,6 +30,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" +compiler-version = "1.22.0" +edition = "legacy" flavor = "sui" diff --git a/move/test/Move.toml b/move/test/Move.toml index a1b50014..83db6e35 100644 --- a/move/test/Move.toml +++ b/move/test/Move.toml @@ -1,6 +1,7 @@ [package] name = "Test" version = "0.1.0" +published-at = "0x5a53377722f36628ee281bcae8b9e8989f198d33f548f1f6e2eb9fcc8ae1c322" edition = "2024.beta" [dependencies] @@ -8,4 +9,4 @@ Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-fram AxelarGateway = { local = "../axelar_gateway" } [addresses] -test = "0x200" +test = "0x5a53377722f36628ee281bcae8b9e8989f198d33f548f1f6e2eb9fcc8ae1c322" diff --git a/move/test/sources/test/test.move b/move/test/sources/test/test.move index 690ceed7..fbea0ed6 100644 --- a/move/test/sources/test/test.move +++ b/move/test/sources/test/test.move @@ -68,4 +68,8 @@ module test::test { event::emit(Executed { data: payload }); } + + public fun test(arg1: vector, arg2: u64, arg3: u256) { + + } } diff --git a/scripts/publish-package.js b/scripts/publish-package.js index 78a3210c..297ae424 100644 --- a/scripts/publish-package.js +++ b/scripts/publish-package.js @@ -1,5 +1,5 @@ require('dotenv').config(); -const { setConfig, getFullObject, requestSuiFromFaucet } = require('./utils'); +const { setConfig, getFullObject, requestSuiFromFaucet, updateMoveToml } = require('./utils'); const { Ed25519Keypair } = require('@mysten/sui.js/keypairs/ed25519'); const { TransactionBlock } = require('@mysten/sui.js/transactions'); const { SuiClient } = require('@mysten/sui.js/client'); @@ -10,8 +10,7 @@ const fs = require('fs'); const path = require('path'); async function publishPackage(packageName, client, keypair) { - const toml = fs.readFileSync(`${__dirname}/../move/${packageName}/Move.toml`, 'utf8'); - fs.writeFileSync(`${__dirname}/../move/${packageName}/Move.toml`, fillAddresses(toml, '0x0', packageName)); + updateMoveToml(packageName, '0x0'); // remove all controlled temporary objects on process exit const address = keypair.getPublicKey().toSuiAddress(); @@ -47,8 +46,7 @@ async function publishPackage(packageName, client, keypair) { showEffects: true, showObjectChanges: true, showContent: true, - }, - requestType: 'WaitForLocalExecution', + } }); if (publishTxn.effects?.status.status !== 'success') throw new Error('Publish Tx failed'); @@ -56,57 +54,6 @@ async function publishPackage(packageName, client, keypair) { console.info(`Published package ${packageId} from address ${address}}`); - return { packageId, publishTxn }; -} - -function updateMoveToml(packageName, packageId) { - const path = `${__dirname}/../move/${packageName}/Move.toml`; - const toml = fs.readFileSync(path, 'utf8'); - fs.writeFileSync(path, fillAddresses(insertPublishedAt(toml, packageId), packageId, packageName)); -} - -function insertPublishedAt(toml, packageId) { - const lines = toml.split('\n'); - const versionLineIndex = lines.findIndex((line) => line.slice(0, 7) === 'version'); - - if (!(lines[versionLineIndex + 1].slice(0, 12) === 'published-at')) { - lines.splice(versionLineIndex + 1, 0, ''); - } - - lines[versionLineIndex + 1] = `published-at = "${packageId}"`; - return lines.join('\n'); -} - -function fillAddresses(toml, address, packageName) { - const lines = toml.split('\n'); - const addressesIndex = lines.findIndex((line) => line.slice(0, 11) === '[addresses]'); - - for (let i = addressesIndex + 1; i < lines.length; i++) { - const line = lines[i]; - const eqIndex = line.indexOf('='); - - if (eqIndex < 0 || line.slice(0, eqIndex - 1) !== packageName) { - continue; - } - - lines[i] = line.slice(0, eqIndex + 1) + ` "${address}"`; - } - - return lines.join('\n'); -} - -async function publishPackageFull(packageName, client, keypair, env) { - const { packageId, publishTxn } = await publishPackage(packageName, client, keypair); - const info = require(`${__dirname}/../move/${packageName}/info.json`); - const config = {}; - config.packageId = packageId; - - for (const singleton of info.singletons) { - const object = publishTxn.objectChanges.find((object) => object.objectType === `${packageId}::${singleton}`); - config[singleton] = await getFullObject(object, client); - } - - setConfig(packageName, env.alias, config); updateMoveToml(packageName, packageId); return { packageId, publishTxn }; @@ -114,8 +61,6 @@ async function publishPackageFull(packageName, client, keypair, env) { module.exports = { publishPackage, - updateMoveToml, - publishPackageFull, }; if (require.main === module) { @@ -134,6 +79,6 @@ if (require.main === module) { await requestSuiFromFaucet(env, address); } - await publishPackageFull(packageName, client, keypair, env); + await publishPackage(packageName, client, keypair, env); })(); } diff --git a/scripts/test.js b/scripts/test.js new file mode 100644 index 00000000..a58f30cf --- /dev/null +++ b/scripts/test.js @@ -0,0 +1,76 @@ +require('dotenv').config(); +const { setConfig, getFullObject, requestSuiFromFaucet, updateMoveToml } = require('./utils'); +const { Ed25519Keypair } = require('@mysten/sui.js/keypairs/ed25519'); +const { TransactionBlock } = require('@mysten/sui.js/transactions'); +const { SuiClient } = require('@mysten/sui.js/client'); +const { execSync } = require('child_process'); +const { parseEnv } = require('./utils'); +const tmp = require('tmp'); +const fs = require('fs'); +const path = require('path'); +const { publishPackage } = require("./publish-package"); +const { bcs } = require('@mysten/bcs'); +const { + utils: { arrayify, hexlify }, +} = require('ethers'); + + +(async () => { + const env = parseEnv('localnet'); + const privKey = Buffer.from(process.env.SUI_PRIVATE_KEY, 'hex'); + const keypair = Ed25519Keypair.fromSecretKey(privKey); + // create a new SuiClient object pointing to the network you want to use + const client = new SuiClient({ url: env.url }); + const {packageId, publishTxn} = await publishPackage('test', client, keypair); + const singleton = publishTxn.objectChanges.find((change) => change.objectType == `${packageId}::test::Singleton`); + + const func = await client.getNormalizedMoveFunction({package: packageId, module: 'test', function: "test"}); + + const types = func.parameters.map(parameter => parameter.toLowerCase()); + const args = [ + "0x9027dcb35b21318572bda38641b394eb33896aa81878a4f0e7066b119a9ea000", + 13453453423423, + 13453453423423, + ]; + bcs.address = () => bcs.fixedArray(32, bcs.u8()).transform({ + input: (id) => arrayify(id), + output: (id) => hexlify(id), + }); + + bcs.vectorU8 = () => bcs.vector(bcs.u8()).transform({ + input: (input) => { + if(typeof(input) === 'string') input = arrayify(input); + return input; + } + }) + + const serialize = (type, arg) => { + const serializer = (type) => { + if (typeof(type) === 'string') { + return bcs[type](); + } else if (type.Vector) { + if(type.Vector === 'U8') { + return bcs.vectorU8(); + } + return bcs.vector(serializer(type.Vector)); + } else { + return null; + } + } + return serializer(type).serialize(arg).toBytes(); + } + + const tx = new TransactionBlock(); + + tx.moveCall({ + target: `${packageId}::test::test`, + arguments: types.map((type, index) => { + return tx.pure(serialize(type, args[index])); + }), + }); + + await client.signAndExecuteTransactionBlock({ + transactionBlock: tx, + signer: keypair + }) +})(); \ No newline at end of file diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js new file mode 100644 index 00000000..7647b74b --- /dev/null +++ b/scripts/tx-builder.js @@ -0,0 +1,69 @@ +const objectCache = {}; + +function updateCache(txResponse) { + for(const change of txResponse.objectChanges) { + objectCache[change.objectId] = change; + } +} + +function getObject(objectId) { + return objectCache[objectId]; +} + +function serialize (type, arg) { + bcs.address = () => bcs.fixedArray(32, bcs.u8()).transform({ + input: (id) => arrayify(id), + output: (id) => hexlify(id), + }); + + const vectorU8 = () => bcs.vector(bcs.u8()).transform({ + input: (input) => { + if(typeof(input) === 'string') input = arrayify(input); + return bcs.vector(bcs.u8()).serialize(input).toBytes(); + } + }) + + const serializer = (type) => { + if (typeof(type) === 'string') { + return bcs[type](); + } else if (type.Vector) { + if(type.Vector === 'U8') { + return vectorU8(); + } + return bcs.vector(serializer(type.Vector)); + } else { + return null; + } + } + return serializer(type).serialize(arg).toBytes(); +} + +function TxBuilder() { + let tx; + let client; + let keypair; + async function moveCall(target, arguments, typeArguments) { + // If target is string, convert to object that `getNormalizedMoveFunction` accepts. + if(typeof(target) === 'string') { + const first = target.indexOf(':'); + const last = target.indexOf(':', first + 2); + const packageId = target.slice(0, first); + const module = target.slice(first + 2, last); + const functionName = target.slice(last + 2); + target = { + packageId, + module, + function: functionName, + } + } + const moveFn = await client.getNormalizedMoveFunction(target); + + } +} + + + +module.exports = { + updateCache, + getObject, +} \ No newline at end of file diff --git a/scripts/utils.js b/scripts/utils.js index b722b17b..5c4239bd 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -5,10 +5,6 @@ const configs = {}; const { requestSuiFromFaucetV0, getFaucetHost } = require('@mysten/sui.js/faucet'); const { getFullnodeUrl } = require('@mysten/sui.js/client'); -function toPure(hexString) { - return String.fromCharCode(...arrayify(hexString)); -} - function getModuleNameFromSymbol(symbol) { function isNumber(char) { return char >= '0' && char <= '9'; @@ -47,41 +43,6 @@ function getModuleNameFromSymbol(symbol) { return moduleName; } -function getConfig(packagePath, envAlias) { - if (!configs[packagePath]) { - configs[packagePath] = fs.existsSync(`${__dirname}/../info/${packagePath}.json`) - ? JSON.parse(fs.readFileSync(`${__dirname}/../info/${packagePath}.json`)) - : {}; - } - - return configs[packagePath][envAlias]; -} - -function setConfig(packagePath, envAlias, config) { - if (!configs[packagePath]) { - try { - configs[packagePath] = require(`${__dirname}/../info/${packagePath}.json`); - } catch (e) { - switch (e.code) { - case 'MODULE_NOT_FOUND': - case undefined: - configs[packagePath] = {}; - break; - default: - throw e; - } - } - } - - configs[packagePath][envAlias] = config; - - if (!fs.existsSync(`${__dirname}/../info`)) { - fs.mkdirSync(`${__dirname}/../info`); - } - - fs.writeFileSync(`${__dirname}/../info/${packagePath}.json`, JSON.stringify(configs[packagePath], null, 4)); -} - async function requestSuiFromFaucet(env, address) { try { await requestSuiFromFaucetV0({ @@ -95,44 +56,38 @@ async function requestSuiFromFaucet(env, address) { } } -async function getFullObject(object, client) { - for (const field of ['type', 'sender', 'owner']) { - if (object[field]) { - delete object[field]; - } +function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move`) { + + const path = `${moveDir}/${packageName}/Move.toml`; + + let toml = fs.readFileSync(path, 'utf8'); + + const lines = toml.split('\n'); + + const versionLineIndex = lines.findIndex((line) => line.slice(0, 7) === 'version'); + + if (!(lines[versionLineIndex + 1].slice(0, 12) === 'published-at')) { + lines.splice(versionLineIndex + 1, 0, ''); } - const objectResponce = await client.getObject({ - id: object.objectId, - options: { - showContent: true, - }, - }); - const fields = objectResponce.data.content.fields; - - function decodeFields(fields, object) { - for (const key in fields) { - if (key === 'id') continue; - - if (fields[key].fields) { - if (!fields[key].fields.id) { - object[key] = {}; - decodeFields(fields[key].fields, object[key]); - } else { - object[key] = fields[key].fields.id.id || fields[key].fields.id; - } - } else if (fields[key].id) { - object[key] = fields[key].id; - } else { - object[key] = fields[key]; - } + lines[versionLineIndex + 1] = `published-at = "${packageId}"`; + + const addressesIndex = lines.findIndex((line) => line.slice(0, 11) === '[addresses]'); + + for (let i = addressesIndex + 1; i < lines.length; i++) { + const line = lines[i]; + const eqIndex = line.indexOf('='); + + if (eqIndex < 0 || line.slice(0, packageName.length) !== packageName || line.slice(packageName.length, eqIndex) !== Array(eqIndex - packageName.length + 1).join(' ') ) { + continue; } - return object; + lines[i] = line.slice(0, eqIndex + 1) + ` "${packageId}"`; } - decodeFields(fields, object); - return object; + toml = lines.join('\n'); + + fs.writeFileSync(path, toml); } function parseEnv(arg) { @@ -148,11 +103,8 @@ function parseEnv(arg) { } module.exports = { - toPure, getModuleNameFromSymbol, - getConfig, - setConfig, - getFullObject, parseEnv, requestSuiFromFaucet, + updateMoveToml, }; From 296eece0ad3e6fb86a7a7046dd1217cdf19bab2b Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 6 Jun 2024 19:05:20 +0300 Subject: [PATCH 02/11] added the transaction builder --- move/axelar/Move.lock | 27 ------- move/axelar_gateway/Move.toml | 4 +- move/test/Move.toml | 4 +- move/test/sources/test/test.move | 4 -- scripts/test.js | 76 -------------------- scripts/tx-builder.js | 120 ++++++++++++++++++++++++++----- 6 files changed, 105 insertions(+), 130 deletions(-) delete mode 100644 move/axelar/Move.lock delete mode 100644 scripts/test.js diff --git a/move/axelar/Move.lock b/move/axelar/Move.lock deleted file mode 100644 index 875170d6..00000000 --- a/move/axelar/Move.lock +++ /dev/null @@ -1,27 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 0 -manifest_digest = "8B923BAABABD7F78C5ED5E16715CC628AD0DF9E7AF28490F9A625421CE9E384A" -deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/mainnet", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.22.0" -edition = "legacy" -flavor = "sui" diff --git a/move/axelar_gateway/Move.toml b/move/axelar_gateway/Move.toml index 235f55b2..53e54d43 100644 --- a/move/axelar_gateway/Move.toml +++ b/move/axelar_gateway/Move.toml @@ -1,12 +1,12 @@ [package] name = "AxelarGateway" version = "0.1.0" -published-at = "0x2abacf10c39c44760ad2afcfbdf7bc25054d3bd425c520ac770e688fdb74dffd" +published-at = "0x571841ce66dce70e51a123299ed140d6509566c97eb905331b5f28732c707c56" edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" } [addresses] -axelar_gateway = "0x2abacf10c39c44760ad2afcfbdf7bc25054d3bd425c520ac770e688fdb74dffd" +axelar_gateway = "0x571841ce66dce70e51a123299ed140d6509566c97eb905331b5f28732c707c56" clock = "0x6" diff --git a/move/test/Move.toml b/move/test/Move.toml index 83db6e35..cfe2b83d 100644 --- a/move/test/Move.toml +++ b/move/test/Move.toml @@ -1,7 +1,7 @@ [package] name = "Test" version = "0.1.0" -published-at = "0x5a53377722f36628ee281bcae8b9e8989f198d33f548f1f6e2eb9fcc8ae1c322" +published-at = "0x5de4d52cd17c6e0483598bebb3243a886edefeb216e5ecc7c578edfeb8a7b4a9" edition = "2024.beta" [dependencies] @@ -9,4 +9,4 @@ Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-fram AxelarGateway = { local = "../axelar_gateway" } [addresses] -test = "0x5a53377722f36628ee281bcae8b9e8989f198d33f548f1f6e2eb9fcc8ae1c322" +test = "0x5de4d52cd17c6e0483598bebb3243a886edefeb216e5ecc7c578edfeb8a7b4a9" diff --git a/move/test/sources/test/test.move b/move/test/sources/test/test.move index 821265f7..7e9253e9 100644 --- a/move/test/sources/test/test.move +++ b/move/test/sources/test/test.move @@ -68,8 +68,4 @@ module test::test { event::emit(Executed { data: payload }); } - - public fun test(arg1: vector, arg2: u64, arg3: u256) { - - } } diff --git a/scripts/test.js b/scripts/test.js deleted file mode 100644 index a58f30cf..00000000 --- a/scripts/test.js +++ /dev/null @@ -1,76 +0,0 @@ -require('dotenv').config(); -const { setConfig, getFullObject, requestSuiFromFaucet, updateMoveToml } = require('./utils'); -const { Ed25519Keypair } = require('@mysten/sui.js/keypairs/ed25519'); -const { TransactionBlock } = require('@mysten/sui.js/transactions'); -const { SuiClient } = require('@mysten/sui.js/client'); -const { execSync } = require('child_process'); -const { parseEnv } = require('./utils'); -const tmp = require('tmp'); -const fs = require('fs'); -const path = require('path'); -const { publishPackage } = require("./publish-package"); -const { bcs } = require('@mysten/bcs'); -const { - utils: { arrayify, hexlify }, -} = require('ethers'); - - -(async () => { - const env = parseEnv('localnet'); - const privKey = Buffer.from(process.env.SUI_PRIVATE_KEY, 'hex'); - const keypair = Ed25519Keypair.fromSecretKey(privKey); - // create a new SuiClient object pointing to the network you want to use - const client = new SuiClient({ url: env.url }); - const {packageId, publishTxn} = await publishPackage('test', client, keypair); - const singleton = publishTxn.objectChanges.find((change) => change.objectType == `${packageId}::test::Singleton`); - - const func = await client.getNormalizedMoveFunction({package: packageId, module: 'test', function: "test"}); - - const types = func.parameters.map(parameter => parameter.toLowerCase()); - const args = [ - "0x9027dcb35b21318572bda38641b394eb33896aa81878a4f0e7066b119a9ea000", - 13453453423423, - 13453453423423, - ]; - bcs.address = () => bcs.fixedArray(32, bcs.u8()).transform({ - input: (id) => arrayify(id), - output: (id) => hexlify(id), - }); - - bcs.vectorU8 = () => bcs.vector(bcs.u8()).transform({ - input: (input) => { - if(typeof(input) === 'string') input = arrayify(input); - return input; - } - }) - - const serialize = (type, arg) => { - const serializer = (type) => { - if (typeof(type) === 'string') { - return bcs[type](); - } else if (type.Vector) { - if(type.Vector === 'U8') { - return bcs.vectorU8(); - } - return bcs.vector(serializer(type.Vector)); - } else { - return null; - } - } - return serializer(type).serialize(arg).toBytes(); - } - - const tx = new TransactionBlock(); - - tx.moveCall({ - target: `${packageId}::test::test`, - arguments: types.map((type, index) => { - return tx.pure(serialize(type, args[index])); - }), - }); - - await client.signAndExecuteTransactionBlock({ - transactionBlock: tx, - signer: keypair - }) -})(); \ No newline at end of file diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index 7647b74b..12200c68 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -1,16 +1,62 @@ -const objectCache = {}; +const { TransactionBlock } = require('@mysten/sui.js/transactions'); +const { bcs } = require('@mysten/bcs'); +const { + utils: { arrayify, hexlify }, +} = require('ethers'); -function updateCache(txResponse) { - for(const change of txResponse.objectChanges) { - objectCache[change.objectId] = change; +function getObject(tx, object) { + if( typeof(object) === 'string' || Array.isArray(object) ) + return tx.object(object); + return object; +} + +function getTypeName(type) { + function get(type) { + const name = `${type.address}::${type.module}::${type.name}`; + if(type.typeArguments.length > 0) { + name += `<${type.typeArguments[0]}`; + for(let i = 1; i < type.typeArguments.length; i++) { + name += `,${type.typeArguments[i]}`; + } + name += '>'; + } + return name; + } + if ( type.Struct ) { + return get(type.Struct); + } else if ( type.Reference ) { + return getTypeName(type.Reference); + } else if ( type.MutableReference ) { + return getTypeName(type.MutableReference); + } else if (type.Vector) { + return `vector<${getTypeName(type.Vector)}>` + } else { + return type.toLowerCase(); } } -function getObject(objectId) { - return objectCache[objectId]; +function getNestedStruct(tx, type, arg) { + if ( type.Struct || type.Reference || type.MutableReference ) { + return getObject(tx, arg); + } + + if(!type.Vector) return null; + nested = arg.map(arg => getNestedStruct(tx, type.Vector, arg)); + if(!nested) return null; + const typeName = getTypeName(type.Vector); + + return tx.makeMoveVec({ + type: typeName, + objects: nested, + }); } -function serialize (type, arg) { +function serialize (tx, type, arg) { + let struct = getNestedStruct(tx, type, arg) + if(struct) { + return struct; + } + bcs.address = () => bcs.fixedArray(32, bcs.u8()).transform({ input: (id) => arrayify(id), output: (id) => hexlify(id), @@ -25,7 +71,7 @@ function serialize (type, arg) { const serializer = (type) => { if (typeof(type) === 'string') { - return bcs[type](); + return bcs[type.toLowerCase()](); } else if (type.Vector) { if(type.Vector === 'U8') { return vectorU8(); @@ -35,14 +81,26 @@ function serialize (type, arg) { return null; } } - return serializer(type).serialize(arg).toBytes(); + return tx.pure(serializer(type).serialize(arg).toBytes()); } -function TxBuilder() { - let tx; - let client; - let keypair; - async function moveCall(target, arguments, typeArguments) { +function isTxContext(parameter) { + parameter = parameter.MutableReference; + if(!parameter) return false; + parameter = parameter.Struct; + if(!parameter) return false; + return parameter.address === '0x2' && parameter.module === 'tx_context' && parameter.name === 'TxContext'; +} + +class TxBuilder { + constructor(client, keypair) { + this.client = client; + this.keypair = keypair; + this.tx = new TransactionBlock(); + this.tx.object + } + + async moveCall(target, args, typeArguments = []) { // If target is string, convert to object that `getNormalizedMoveFunction` accepts. if(typeof(target) === 'string') { const first = target.indexOf(':'); @@ -51,19 +109,43 @@ function TxBuilder() { const module = target.slice(first + 2, last); const functionName = target.slice(last + 2); target = { - packageId, + package: packageId, module, function: functionName, } } - const moveFn = await client.getNormalizedMoveFunction(target); + const moveFn = await this.client.getNormalizedMoveFunction(target); + + let length = moveFn.parameters.length; + if(isTxContext(moveFn.parameters[length - 1])) length = length - 1; + if(length != args.length) throw new Error(`Function ${target.package}::${target.module}::${target.function} takes ${moveFn.parameters.length} arguments but given ${args.length}`); + const convertedArgs = args.map((arg, index) => serialize(this.tx, moveFn.parameters[index], arg)); + + return this.tx.moveCall({ + target: `${target.package}::${target.module}::${target.function}`, + arguments: convertedArgs, + typeArguments: typeArguments, + }) + } + + async signAndExecute(options) { + const result = await this.client.signAndExecuteTransactionBlock({ + transactionBlock: this.tx, + signer: this.keypair, + options: { + showEffects: true, + showObjectChanges: true, + showContent: true, + ...options + } + }); + return result; } } module.exports = { - updateCache, - getObject, -} \ No newline at end of file + TxBuilder +} From edeeb38d390d2762457498f62d618f94330cdc74 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 6 Jun 2024 19:23:03 +0300 Subject: [PATCH 03/11] lint and prettier --- scripts/publish-package.js | 5 +- scripts/tx-builder.js | 109 ++++++++++++++++++++----------------- scripts/utils.js | 16 +++--- 3 files changed, 70 insertions(+), 60 deletions(-) diff --git a/scripts/publish-package.js b/scripts/publish-package.js index 297ae424..767d0e28 100644 --- a/scripts/publish-package.js +++ b/scripts/publish-package.js @@ -1,12 +1,11 @@ require('dotenv').config(); -const { setConfig, getFullObject, requestSuiFromFaucet, updateMoveToml } = require('./utils'); +const { requestSuiFromFaucet, updateMoveToml } = require('./utils'); const { Ed25519Keypair } = require('@mysten/sui.js/keypairs/ed25519'); const { TransactionBlock } = require('@mysten/sui.js/transactions'); const { SuiClient } = require('@mysten/sui.js/client'); const { execSync } = require('child_process'); const { parseEnv } = require('./utils'); const tmp = require('tmp'); -const fs = require('fs'); const path = require('path'); async function publishPackage(packageName, client, keypair) { @@ -46,7 +45,7 @@ async function publishPackage(packageName, client, keypair) { showEffects: true, showObjectChanges: true, showContent: true, - } + }, }); if (publishTxn.effects?.status.status !== 'success') throw new Error('Publish Tx failed'); diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index 12200c68..d1f827c4 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -5,90 +5,99 @@ const { } = require('ethers'); function getObject(tx, object) { - if( typeof(object) === 'string' || Array.isArray(object) ) - return tx.object(object); + if (typeof object === 'string' || Array.isArray(object)) return tx.object(object); return object; } function getTypeName(type) { function get(type) { - const name = `${type.address}::${type.module}::${type.name}`; - if(type.typeArguments.length > 0) { + let name = `${type.address}::${type.module}::${type.name}`; + + if (type.typeArguments.length > 0) { name += `<${type.typeArguments[0]}`; - for(let i = 1; i < type.typeArguments.length; i++) { + + for (let i = 1; i < type.typeArguments.length; i++) { name += `,${type.typeArguments[i]}`; } + name += '>'; } + return name; } - if ( type.Struct ) { + + if (type.Struct) { return get(type.Struct); - } else if ( type.Reference ) { + } else if (type.Reference) { return getTypeName(type.Reference); - } else if ( type.MutableReference ) { + } else if (type.MutableReference) { return getTypeName(type.MutableReference); } else if (type.Vector) { - return `vector<${getTypeName(type.Vector)}>` - } else { - return type.toLowerCase(); + return `vector<${getTypeName(type.Vector)}>`; } + + return type.toLowerCase(); } function getNestedStruct(tx, type, arg) { - if ( type.Struct || type.Reference || type.MutableReference ) { + if (type.Struct || type.Reference || type.MutableReference) { return getObject(tx, arg); } - if(!type.Vector) return null; - nested = arg.map(arg => getNestedStruct(tx, type.Vector, arg)); - if(!nested) return null; + if (!type.Vector) return null; + const nested = arg.map((arg) => getNestedStruct(tx, type.Vector, arg)); + if (!nested) return null; const typeName = getTypeName(type.Vector); return tx.makeMoveVec({ - type: typeName, + type: typeName, objects: nested, }); } -function serialize (tx, type, arg) { - let struct = getNestedStruct(tx, type, arg) - if(struct) { +function serialize(tx, type, arg) { + const struct = getNestedStruct(tx, type, arg); + + if (struct) { return struct; } - bcs.address = () => bcs.fixedArray(32, bcs.u8()).transform({ - input: (id) => arrayify(id), - output: (id) => hexlify(id), - }); + bcs.address = () => + bcs.fixedArray(32, bcs.u8()).transform({ + input: (id) => arrayify(id), + output: (id) => hexlify(id), + }); - const vectorU8 = () => bcs.vector(bcs.u8()).transform({ - input: (input) => { - if(typeof(input) === 'string') input = arrayify(input); - return bcs.vector(bcs.u8()).serialize(input).toBytes(); - } - }) + const vectorU8 = () => + bcs.vector(bcs.u8()).transform({ + input(input) { + if (typeof input === 'string') input = arrayify(input); + return bcs.vector(bcs.u8()).serialize(input).toBytes(); + }, + }); const serializer = (type) => { - if (typeof(type) === 'string') { + if (typeof type === 'string') { return bcs[type.toLowerCase()](); } else if (type.Vector) { - if(type.Vector === 'U8') { + if (type.Vector === 'U8') { return vectorU8(); } + return bcs.vector(serializer(type.Vector)); - } else { - return null; } - } + + return null; + }; + return tx.pure(serializer(type).serialize(arg).toBytes()); } function isTxContext(parameter) { parameter = parameter.MutableReference; - if(!parameter) return false; + if (!parameter) return false; parameter = parameter.Struct; - if(!parameter) return false; + if (!parameter) return false; return parameter.address === '0x2' && parameter.module === 'tx_context' && parameter.name === 'TxContext'; } @@ -97,12 +106,12 @@ class TxBuilder { this.client = client; this.keypair = keypair; this.tx = new TransactionBlock(); - this.tx.object + this.tx.object; } async moveCall(target, args, typeArguments = []) { // If target is string, convert to object that `getNormalizedMoveFunction` accepts. - if(typeof(target) === 'string') { + if (typeof target === 'string') { const first = target.indexOf(':'); const last = target.indexOf(':', first + 2); const packageId = target.slice(0, first); @@ -112,21 +121,25 @@ class TxBuilder { package: packageId, module, function: functionName, - } + }; } + const moveFn = await this.client.getNormalizedMoveFunction(target); let length = moveFn.parameters.length; - if(isTxContext(moveFn.parameters[length - 1])) length = length - 1; - if(length != args.length) throw new Error(`Function ${target.package}::${target.module}::${target.function} takes ${moveFn.parameters.length} arguments but given ${args.length}`); + if (isTxContext(moveFn.parameters[length - 1])) length = length - 1; + if (length !== args.length) + throw new Error( + `Function ${target.package}::${target.module}::${target.function} takes ${moveFn.parameters.length} arguments but given ${args.length}`, + ); const convertedArgs = args.map((arg, index) => serialize(this.tx, moveFn.parameters[index], arg)); return this.tx.moveCall({ target: `${target.package}::${target.module}::${target.function}`, arguments: convertedArgs, - typeArguments: typeArguments, - }) + typeArguments, + }); } async signAndExecute(options) { @@ -137,15 +150,13 @@ class TxBuilder { showEffects: true, showObjectChanges: true, showContent: true, - ...options - } + ...options, + }, }); return result; } } - - module.exports = { - TxBuilder -} + TxBuilder, +}; diff --git a/scripts/utils.js b/scripts/utils.js index 5c4239bd..9a7ec6c2 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -1,7 +1,4 @@ -const { arrayify } = require('ethers/lib/utils'); const fs = require('fs'); - -const configs = {}; const { requestSuiFromFaucetV0, getFaucetHost } = require('@mysten/sui.js/faucet'); const { getFullnodeUrl } = require('@mysten/sui.js/client'); @@ -57,9 +54,8 @@ async function requestSuiFromFaucet(env, address) { } function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move`) { - const path = `${moveDir}/${packageName}/Move.toml`; - + let toml = fs.readFileSync(path, 'utf8'); const lines = toml.split('\n'); @@ -77,8 +73,12 @@ function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move` for (let i = addressesIndex + 1; i < lines.length; i++) { const line = lines[i]; const eqIndex = line.indexOf('='); - - if (eqIndex < 0 || line.slice(0, packageName.length) !== packageName || line.slice(packageName.length, eqIndex) !== Array(eqIndex - packageName.length + 1).join(' ') ) { + + if ( + eqIndex < 0 || + line.slice(0, packageName.length) !== packageName || + line.slice(packageName.length, eqIndex) !== Array(eqIndex - packageName.length + 1).join(' ') + ) { continue; } @@ -86,7 +86,7 @@ function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move` } toml = lines.join('\n'); - + fs.writeFileSync(path, toml); } From 5d3543c03c935b8626e90f10c118ea0548eebf72 Mon Sep 17 00:00:00 2001 From: Foivos Date: Fri, 7 Jun 2024 12:28:19 +0300 Subject: [PATCH 04/11] fixed some bugs --- scripts/tx-builder.js | 64 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index d1f827c4..1c129394 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -5,7 +5,14 @@ const { } = require('ethers'); function getObject(tx, object) { - if (typeof object === 'string' || Array.isArray(object)) return tx.object(object); + if (Array.isArray(object)) { + object = hexlify(object); + } + + if (typeof object === 'string') { + return tx.object(object); + } + return object; } @@ -40,15 +47,27 @@ function getTypeName(type) { } function getNestedStruct(tx, type, arg) { + let inside = type; + + while (inside.Vector) { + inside = inside.Vector; + } + + if (!inside.Struct && !inside.Reference && !inside.MutableReference) { + return null; + } + + if (isString(inside)) { + return null; + } + if (type.Struct || type.Reference || type.MutableReference) { return getObject(tx, arg); } if (!type.Vector) return null; const nested = arg.map((arg) => getNestedStruct(tx, type.Vector, arg)); - if (!nested) return null; const typeName = getTypeName(type.Vector); - return tx.makeMoveVec({ type: typeName, objects: nested, @@ -72,11 +91,15 @@ function serialize(tx, type, arg) { bcs.vector(bcs.u8()).transform({ input(input) { if (typeof input === 'string') input = arrayify(input); - return bcs.vector(bcs.u8()).serialize(input).toBytes(); + return input; }, }); const serializer = (type) => { + if (isString(type)) { + return bcs.string(); + } + if (typeof type === 'string') { return bcs[type.toLowerCase()](); } else if (type.Vector) { @@ -101,12 +124,20 @@ function isTxContext(parameter) { return parameter.address === '0x2' && parameter.module === 'tx_context' && parameter.name === 'TxContext'; } +function isString(parameter) { + if (parameter.MutableReference) parameter = parameter.MutableReference; + if (parameter.Reference) parameter = parameter.Reference; + parameter = parameter.Struct; + if (!parameter) return false; + const isAsciiString = parameter.address === '0x1' && parameter.module === 'ascii' && parameter.name === 'String'; + const isStringString = parameter.address === '0x1' && parameter.module === 'string' && parameter.name === 'String'; + return isAsciiString || isStringString; +} + class TxBuilder { - constructor(client, keypair) { + constructor(client) { this.client = client; - this.keypair = keypair; this.tx = new TransactionBlock(); - this.tx.object; } async moveCall(target, args, typeArguments = []) { @@ -142,10 +173,25 @@ class TxBuilder { }); } - async signAndExecute(options) { + async signAndExecute(keypair, options) { const result = await this.client.signAndExecuteTransactionBlock({ transactionBlock: this.tx, - signer: this.keypair, + signer: keypair, + options: { + showEffects: true, + showObjectChanges: true, + showContent: true, + ...options, + }, + }); + return result; + } + + async devInspect(sender, options) { + const result = await this.client.devInspectTransactionBlock({ + transactionBlock: this.tx, + sender, + options: { showEffects: true, showObjectChanges: true, From bc6ecc20ad5a167ee332e83f90195052c7974f2a Mon Sep 17 00:00:00 2001 From: Foivos Date: Tue, 18 Jun 2024 13:38:45 +0300 Subject: [PATCH 05/11] shorten typeName calculation as per euro's request --- scripts/tx-builder.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index 1c129394..6b7f1e01 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -19,15 +19,9 @@ function getObject(tx, object) { function getTypeName(type) { function get(type) { let name = `${type.address}::${type.module}::${type.name}`; - + if (type.typeArguments.length > 0) { - name += `<${type.typeArguments[0]}`; - - for (let i = 1; i < type.typeArguments.length; i++) { - name += `,${type.typeArguments[i]}`; - } - - name += '>'; + name += type.typeArguments.join(','); } return name; From 1edfffb492f7638668b1602a8afe6feae02eeb8f Mon Sep 17 00:00:00 2001 From: Foivos Date: Tue, 18 Jun 2024 13:42:15 +0300 Subject: [PATCH 06/11] prettier --- scripts/tx-builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index 6b7f1e01..005558f4 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -19,7 +19,7 @@ function getObject(tx, object) { function getTypeName(type) { function get(type) { let name = `${type.address}::${type.module}::${type.name}`; - + if (type.typeArguments.length > 0) { name += type.typeArguments.join(','); } From 3b8255eb1cc2c9e9c5cfc20744f66b4b929f8c0c Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 4 Jul 2024 17:20:40 +0300 Subject: [PATCH 07/11] add a utility to copy move modules --- .gitignore | 2 ++ scripts/utils.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3ddb2f7c..769703ba 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ target/ # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + +move_comile diff --git a/scripts/utils.js b/scripts/utils.js index 9a7ec6c2..d031f7cb 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -53,7 +53,7 @@ async function requestSuiFromFaucet(env, address) { } } -function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move`) { +function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move_compile`) { const path = `${moveDir}/${packageName}/Move.toml`; let toml = fs.readFileSync(path, 'utf8'); @@ -90,6 +90,12 @@ function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move` fs.writeFileSync(path, toml); } +function copyMoveModule(packageName, moveDir = `${__dirname}../move`, moveCompileDir = `${__dirname}/move_compile`) { + const src = `${moveDir}/${packageName}`; + const dest = `${moveDir}/${packageName}`; + fs.cpSync(src, dest, {recursive: true}); +} + function parseEnv(arg) { switch (arg?.toLowerCase()) { case 'localnet': From c4c009169ea72caf717ae8f99bd33d695fa0486b Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 4 Jul 2024 18:01:39 +0300 Subject: [PATCH 08/11] clean up move dir --- move/abi/Move.lock | 26 ------------ move/abi/info.json | 4 -- move/axelar_gateway/Move.lock | 26 ------------ move/axelar_gateway/Move.toml | 2 +- move/axelar_gateway/info.json | 5 --- move/gas_service/Move.lock | 26 ------------ move/gas_service/info.json | 5 --- move/governance/Move.lock | 44 -------------------- move/governance/info.json | 4 -- move/interchain_token/Move.lock | 26 ------------ move/its/Move.lock | 54 ------------------------ move/its/info.json | 5 --- move/squid/Move.lock | 74 --------------------------------- move/squid/info.json | 5 --- 14 files changed, 1 insertion(+), 305 deletions(-) delete mode 100644 move/abi/Move.lock delete mode 100644 move/abi/info.json delete mode 100644 move/axelar_gateway/Move.lock delete mode 100644 move/axelar_gateway/info.json delete mode 100644 move/gas_service/Move.lock delete mode 100644 move/gas_service/info.json delete mode 100644 move/governance/Move.lock delete mode 100644 move/governance/info.json delete mode 100644 move/interchain_token/Move.lock delete mode 100644 move/its/Move.lock delete mode 100644 move/its/info.json delete mode 100644 move/squid/Move.lock delete mode 100644 move/squid/info.json diff --git a/move/abi/Move.lock b/move/abi/Move.lock deleted file mode 100644 index d50f85dc..00000000 --- a/move/abi/Move.lock +++ /dev/null @@ -1,26 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "89B38FFD4D0D8B2DCFE440924446CCF3A347EA904B2657C9CA229BD7BB881131" -deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.22.0" -edition = "legacy" -flavor = "sui" diff --git a/move/abi/info.json b/move/abi/info.json deleted file mode 100644 index 171fda61..00000000 --- a/move/abi/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singletons": [ - ] -} \ No newline at end of file diff --git a/move/axelar_gateway/Move.lock b/move/axelar_gateway/Move.lock deleted file mode 100644 index 281d8e01..00000000 --- a/move/axelar_gateway/Move.lock +++ /dev/null @@ -1,26 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "10303CE6C59BAA2CE814E3D11BACC8CB24BE0F8D66753B02190E291CA40F0D39" -deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.22.0" -edition = "legacy" -flavor = "sui" diff --git a/move/axelar_gateway/Move.toml b/move/axelar_gateway/Move.toml index 53e54d43..758ef53b 100644 --- a/move/axelar_gateway/Move.toml +++ b/move/axelar_gateway/Move.toml @@ -8,5 +8,5 @@ edition = "2024.beta" Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" } [addresses] -axelar_gateway = "0x571841ce66dce70e51a123299ed140d6509566c97eb905331b5f28732c707c56" +axelar_gateway = "0x100" clock = "0x6" diff --git a/move/axelar_gateway/info.json b/move/axelar_gateway/info.json deleted file mode 100644 index 2d9bb195..00000000 --- a/move/axelar_gateway/info.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singletons": [ - "discovery::RelayerDiscovery" - ] -} \ No newline at end of file diff --git a/move/gas_service/Move.lock b/move/gas_service/Move.lock deleted file mode 100644 index 3b8e9178..00000000 --- a/move/gas_service/Move.lock +++ /dev/null @@ -1,26 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "C1DEC087FF16954984395BB68E2E81D4A38E64A7F0BAB88AAF73A121C563E2D4" -deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" -flavor = "sui" diff --git a/move/gas_service/info.json b/move/gas_service/info.json deleted file mode 100644 index 9c69bda1..00000000 --- a/move/gas_service/info.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singletons": [ - "gas_service::GasService" - ] -} \ No newline at end of file diff --git a/move/governance/Move.lock b/move/governance/Move.lock deleted file mode 100644 index 92609743..00000000 --- a/move/governance/Move.lock +++ /dev/null @@ -1,44 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "4F26118CD341A5D382F6D63184C33AE0DEFBC380DA34B844908B98C7C2B228D9" -deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" -dependencies = [ - { name = "Abi" }, - { name = "AxelarGateway" }, - { name = "Sui" }, -] - -[[move.package]] -name = "Abi" -source = { local = "../abi" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "AxelarGateway" -source = { local = "../axelar_gateway" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" -flavor = "sui" diff --git a/move/governance/info.json b/move/governance/info.json deleted file mode 100644 index 171fda61..00000000 --- a/move/governance/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singletons": [ - ] -} \ No newline at end of file diff --git a/move/interchain_token/Move.lock b/move/interchain_token/Move.lock deleted file mode 100644 index e724791e..00000000 --- a/move/interchain_token/Move.lock +++ /dev/null @@ -1,26 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "DD779F8BB7EFE326F7F6ECEA9DB375E63D53DF5DBD30BF2C6230241EBE1E6B2B" -deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" -flavor = "sui" diff --git a/move/its/Move.lock b/move/its/Move.lock deleted file mode 100644 index 06cc4987..00000000 --- a/move/its/Move.lock +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "8EB070D5A26ADEEBB191384EDCD8FE28EE8539D051B47C110ACB2E1BC0675B6A" -deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" -dependencies = [ - { name = "AxelarGateway" }, - { name = "Governance" }, - { name = "Sui" }, -] - -[[move.package]] -name = "Abi" -source = { local = "../abi" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "AxelarGateway" -source = { local = "../axelar_gateway" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "Governance" -source = { local = "../governance" } - -dependencies = [ - { name = "Abi" }, - { name = "AxelarGateway" }, - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" -flavor = "sui" diff --git a/move/its/info.json b/move/its/info.json deleted file mode 100644 index f102daaf..00000000 --- a/move/its/info.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singletons": [ - "its::ITS" - ] -} \ No newline at end of file diff --git a/move/squid/Move.lock b/move/squid/Move.lock deleted file mode 100644 index d9e2d31f..00000000 --- a/move/squid/Move.lock +++ /dev/null @@ -1,74 +0,0 @@ -# @generated by Move, please check-in and do not edit manually. - -[move] -version = 2 -manifest_digest = "9568F12CBDAE1FD019A32A5F77C0B7CF8038887E8FAFE61D45CD75757251E932" -deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" -dependencies = [ - { name = "AxelarGateway" }, - { name = "DeepBook" }, - { name = "ITS" }, - { name = "Sui" }, -] - -[[move.package]] -name = "Abi" -source = { local = "../abi" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "AxelarGateway" -source = { local = "../axelar_gateway" } - -dependencies = [ - { name = "Sui" }, -] - -[[move.package]] -name = "DeepBook" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/deepbook" } - -dependencies = [ - { name = "MoveStdlib" }, - { name = "Sui" }, -] - -[[move.package]] -name = "Governance" -source = { local = "../governance" } - -dependencies = [ - { name = "Abi" }, - { name = "AxelarGateway" }, - { name = "Sui" }, -] - -[[move.package]] -name = "ITS" -source = { local = "../its" } - -dependencies = [ - { name = "AxelarGateway" }, - { name = "Governance" }, - { name = "Sui" }, -] - -[[move.package]] -name = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } - -[[move.package]] -name = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } - -dependencies = [ - { name = "MoveStdlib" }, -] - -[move.toolchain-version] -compiler-version = "1.25.1" -edition = "2024.beta" -flavor = "sui" diff --git a/move/squid/info.json b/move/squid/info.json deleted file mode 100644 index aad271fc..00000000 --- a/move/squid/info.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singletons": [ - "squid::Squid" - ] -} \ No newline at end of file From 9f3e387dd668402c27f07bff98ce882df69094e5 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 4 Jul 2024 18:04:59 +0300 Subject: [PATCH 09/11] some styling --- scripts/tx-builder.js | 14 ++++++++++++-- scripts/utils.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/tx-builder.js b/scripts/tx-builder.js index 005558f4..0f830a60 100644 --- a/scripts/tx-builder.js +++ b/scripts/tx-builder.js @@ -120,11 +120,16 @@ function isTxContext(parameter) { function isString(parameter) { if (parameter.MutableReference) parameter = parameter.MutableReference; + if (parameter.Reference) parameter = parameter.Reference; + parameter = parameter.Struct; + if (!parameter) return false; + const isAsciiString = parameter.address === '0x1' && parameter.module === 'ascii' && parameter.name === 'String'; const isStringString = parameter.address === '0x1' && parameter.module === 'string' && parameter.name === 'String'; + return isAsciiString || isStringString; } @@ -152,11 +157,16 @@ class TxBuilder { const moveFn = await this.client.getNormalizedMoveFunction(target); let length = moveFn.parameters.length; - if (isTxContext(moveFn.parameters[length - 1])) length = length - 1; - if (length !== args.length) + + if (isTxContext(moveFn.parameters[length - 1])) { + length = length - 1; + } + + if (length !== args.length) { throw new Error( `Function ${target.package}::${target.module}::${target.function} takes ${moveFn.parameters.length} arguments but given ${args.length}`, ); + } const convertedArgs = args.map((arg, index) => serialize(this.tx, moveFn.parameters[index], arg)); diff --git a/scripts/utils.js b/scripts/utils.js index d031f7cb..35e85d0d 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -93,7 +93,7 @@ function updateMoveToml(packageName, packageId, moveDir = `${__dirname}/../move_ function copyMoveModule(packageName, moveDir = `${__dirname}../move`, moveCompileDir = `${__dirname}/move_compile`) { const src = `${moveDir}/${packageName}`; const dest = `${moveDir}/${packageName}`; - fs.cpSync(src, dest, {recursive: true}); + fs.cpSync(src, dest, { recursive: true }); } function parseEnv(arg) { From 3d36d79128e6b0f434950f0f94500897fceace2d Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 4 Jul 2024 18:14:56 +0300 Subject: [PATCH 10/11] made lint --- scripts/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/utils.js b/scripts/utils.js index 35e85d0d..e6323c47 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -113,4 +113,5 @@ module.exports = { parseEnv, requestSuiFromFaucet, updateMoveToml, + copyMoveModule, }; From 3d3ca1b366de1964d22ab1846776e4cb8ebbad1e Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 4 Jul 2024 18:17:05 +0300 Subject: [PATCH 11/11] adding all the move.lock files back --- move/abi/Move.lock | 26 ++++++++++++ move/axelar_gateway/Move.lock | 26 ++++++++++++ move/gas_service/Move.lock | 26 ++++++++++++ move/governance/Move.lock | 44 ++++++++++++++++++++ move/interchain_token/Move.lock | 26 ++++++++++++ move/its/Move.lock | 54 ++++++++++++++++++++++++ move/squid/Move.lock | 74 +++++++++++++++++++++++++++++++++ move/test/Move.lock | 6 +-- 8 files changed, 279 insertions(+), 3 deletions(-) create mode 100644 move/abi/Move.lock create mode 100644 move/axelar_gateway/Move.lock create mode 100644 move/gas_service/Move.lock create mode 100644 move/governance/Move.lock create mode 100644 move/interchain_token/Move.lock create mode 100644 move/its/Move.lock create mode 100644 move/squid/Move.lock diff --git a/move/abi/Move.lock b/move/abi/Move.lock new file mode 100644 index 00000000..9ac7913a --- /dev/null +++ b/move/abi/Move.lock @@ -0,0 +1,26 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "134C22A16B63D227C88D4E1F5D02607C8E7C2D0FA5D3BAD6136E0041F441654D" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/axelar_gateway/Move.lock b/move/axelar_gateway/Move.lock new file mode 100644 index 00000000..1c88f022 --- /dev/null +++ b/move/axelar_gateway/Move.lock @@ -0,0 +1,26 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "B3F1114AF6420DAFC5501B8A333236271B0467A5D00AF701F02D79AEC565E6E5" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/gas_service/Move.lock b/move/gas_service/Move.lock new file mode 100644 index 00000000..04215722 --- /dev/null +++ b/move/gas_service/Move.lock @@ -0,0 +1,26 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "C1DEC087FF16954984395BB68E2E81D4A38E64A7F0BAB88AAF73A121C563E2D4" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/governance/Move.lock b/move/governance/Move.lock new file mode 100644 index 00000000..096fd921 --- /dev/null +++ b/move/governance/Move.lock @@ -0,0 +1,44 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "4F26118CD341A5D382F6D63184C33AE0DEFBC380DA34B844908B98C7C2B228D9" +deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" +dependencies = [ + { name = "Abi" }, + { name = "AxelarGateway" }, + { name = "Sui" }, +] + +[[move.package]] +name = "Abi" +source = { local = "../abi" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "AxelarGateway" +source = { local = "../axelar_gateway" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/interchain_token/Move.lock b/move/interchain_token/Move.lock new file mode 100644 index 00000000..8b658462 --- /dev/null +++ b/move/interchain_token/Move.lock @@ -0,0 +1,26 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "DD779F8BB7EFE326F7F6ECEA9DB375E63D53DF5DBD30BF2C6230241EBE1E6B2B" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/its/Move.lock b/move/its/Move.lock new file mode 100644 index 00000000..d45ae8ec --- /dev/null +++ b/move/its/Move.lock @@ -0,0 +1,54 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "8EB070D5A26ADEEBB191384EDCD8FE28EE8539D051B47C110ACB2E1BC0675B6A" +deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" +dependencies = [ + { name = "AxelarGateway" }, + { name = "Governance" }, + { name = "Sui" }, +] + +[[move.package]] +name = "Abi" +source = { local = "../abi" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "AxelarGateway" +source = { local = "../axelar_gateway" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "Governance" +source = { local = "../governance" } + +dependencies = [ + { name = "Abi" }, + { name = "AxelarGateway" }, + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/squid/Move.lock b/move/squid/Move.lock new file mode 100644 index 00000000..f7bcfa21 --- /dev/null +++ b/move/squid/Move.lock @@ -0,0 +1,74 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 2 +manifest_digest = "9568F12CBDAE1FD019A32A5F77C0B7CF8038887E8FAFE61D45CD75757251E932" +deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" +dependencies = [ + { name = "AxelarGateway" }, + { name = "DeepBook" }, + { name = "ITS" }, + { name = "Sui" }, +] + +[[move.package]] +name = "Abi" +source = { local = "../abi" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "AxelarGateway" +source = { local = "../axelar_gateway" } + +dependencies = [ + { name = "Sui" }, +] + +[[move.package]] +name = "DeepBook" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/deepbook" } + +dependencies = [ + { name = "MoveStdlib" }, + { name = "Sui" }, +] + +[[move.package]] +name = "Governance" +source = { local = "../governance" } + +dependencies = [ + { name = "Abi" }, + { name = "AxelarGateway" }, + { name = "Sui" }, +] + +[[move.package]] +name = "ITS" +source = { local = "../its" } + +dependencies = [ + { name = "AxelarGateway" }, + { name = "Governance" }, + { name = "Sui" }, +] + +[[move.package]] +name = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +name = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.25.3", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.26.1" +edition = "2024.beta" +flavor = "sui" diff --git a/move/test/Move.lock b/move/test/Move.lock index 12a46226..ed1e8c31 100644 --- a/move/test/Move.lock +++ b/move/test/Move.lock @@ -2,7 +2,7 @@ [move] version = 2 -manifest_digest = "6DF02196C888A850522C2336E4F8FF37DA00BCBB2240DEBF2500B46D2358E034" +manifest_digest = "E39FD071E9EFD0729A4D15C389E9E5EF831FB1E0DB9B2A6E35AFD0DC302863A1" deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600" dependencies = [ { name = "AxelarGateway" }, @@ -30,6 +30,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.22.0" -edition = "legacy" +compiler-version = "1.26.1" +edition = "2024.beta" flavor = "sui"