Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stellar): its example scripts #490

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ahramy
Copy link
Contributor

@ahramy ahramy commented Jan 7, 2025

@ahramy ahramy requested a review from a team as a code owner January 7, 2025 21:11
stellar/its-example.js Outdated Show resolved Hide resolved
stellar/README.md Outdated Show resolved Hide resolved
stellar/its-example.js Outdated Show resolved Hide resolved
stellar/its-example.js Outdated Show resolved Hide resolved
stellar/its-example.js Outdated Show resolved Hide resolved
minter,
);

await broadcast(operation, wallet, chain, 'Deploy Token', options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the behaviour to not authorize all invocations by default, and authorize it explicitly.

stellar/its-example.js Outdated Show resolved Hide resolved
stellar/its-example.js Outdated Show resolved Hide resolved
stellar/its-example.js Outdated Show resolved Hide resolved
.command('deploy-token <symbol> <name> <decimals> <salt> <initialSupply> ')
.action((symbol, name, decimal, salt, initialSupply, options) => {
mainProcessor(deployToken, [symbol, name, decimal, salt, initialSupply], options);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add canonical registration and deployment?

You should do an e2e test for that as well. To register and deploy XLM to Avalanche.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm facing an authorization issue with deployRemoteCanonicalToken. Work in progress.

@ahramy ahramy force-pushed the feat/add-its-example-scripts branch from 726eb06 to 6c65f8a Compare January 10, 2025 07:38
#### Execute

```bash
node stellar/its.js execute [source-chain] [message-id] [source-address] [payload]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node stellar/its.js execute [source-chain] [message-id] [source-address] [payload]
node stellar/gateway.js execute [source-chain] [message-id] [source-address] [payload]

Move this under gateway section

@@ -77,6 +78,9 @@ async function buildTransaction(operation, server, wallet, networkType, options
const prepareTransaction = async (operation, server, wallet, networkType, options = {}) => {
const builtTransaction = await buildTransaction(operation, server, wallet, networkType, options);

// ahram test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug code

async function setTrustedChain(wallet, _, chain, contractConfig, arg, options) {
const contract = new Contract(contractConfig.address);
async function setTrustedChain(wallet, _, chain, arg, options) {
const contract = new Contract(chain.contracts.interchain_token_service?.address);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provide contract as an arg to reduce duplication

const itsAddressScVal = nativeToScVal(Address.fromString(itsAddress), { type: 'address' });
const axlearScVal = nativeToScVal('axelar', { type: 'string' });
const axelarAddressScVal = nativeToScVal('axelar13ehuhysn5mqjeaheeuew2gjs785f6k7jm8vfsqg3jhtpkwppcmzqtedxty', { type: 'string' });
const payloadHex =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug payload?

await broadcast(operation, wallet, chain, 'Remote Canonical Token Deployed', options);
}

// async function deployRemoteCanonicalTokenOrg(wallet, _, chain, args, options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants