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

Use new soroban-cli token create subcommand #20

Merged
merged 9 commits into from
Oct 4, 2022
Merged

Conversation

paulbellamy
Copy link
Contributor

Use the new soroban-cli token create subcommand from: stellar/stellar-cli#166
This meant I had to update the xdr dependency, and some of the code using that.

@paulbellamy
Copy link
Contributor Author

I think stellar/soroban-examples#123 will fix the build here

@leighmcculloch leighmcculloch self-assigned this Oct 3, 2022
@leighmcculloch
Copy link
Member

@paulbellamy Now that soroban-examples is updated I've pushed the dep update in 304e48f and make test passes. I'm not sure how to tell the full scope of this PR so I'm going to leave it open for you to merge, but looks like it is good to go.

@leighmcculloch
Copy link
Member

I'm taking a quick look if I can remove the dependence on the token example.

@leighmcculloch
Copy link
Member

leighmcculloch commented Oct 4, 2022

In 78cce35 I've pushed changes that remove the dependence on soroban-token-contract. Instead of using any utilities in that example crate, the project relies entirely on the soroban-token-spec for code that ships when deployed, and in tests it uses the simpler Signature::Invoker to authenticate as a source account.

I've change the way auth works for two reasons:

  • It models the type of auth we'll actually be doing with the contract, via Freighter.
  • It's the simpler form of auth that most developers will probably use because it is all they need.

@paulbellamy The simpler form of auth works like this:

  1. First set the source account to the account id you want to authenticate as.
  2. Invoke the contract, telling the contract (that uses soroban-auth) that you're signing as the "Invoker", which is the source account in a direct invocation.

For example:

e.set_source_account(&account_id_you_want_auth_as);
client.approve(&Signature::Invoker, ...)

@leighmcculloch
Copy link
Member

leighmcculloch commented Oct 4, 2022

@paulbellamy For any scripts that need to invoke the token contract, instead of using ed25519 keys/sigs, you can use the --account option:

Screen Shot 2022-10-04 at 12 15 40 AM

Last week I also updated the cli serve subcommand to support account, so this should all be good to go to support any use of accounts in this PR.

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