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

Deploy token contract #166

Merged
merged 30 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e2c6d7a
Extract soroban_rpc crate
Sep 30, 2022
0f93dfe
Add skeleton of asset command
Sep 28, 2022
00d412d
Create asset wrapper in sandbox
Sep 28, 2022
90d0d2a
asset -> token
Sep 28, 2022
5400cd7
Actually deploy contract wrapper in sandbox
Sep 28, 2022
0200b9a
Allow custom salt
Sep 28, 2022
6a24051
First pass at token wrap subcommand
Sep 29, 2022
4d64df2
appease clippy
Sep 29, 2022
8f6e327
Add TODO reminder
Sep 30, 2022
eec6b76
Add 'run_in_sandbox' to token subcommands
Sep 30, 2022
e14b00e
Add token create support for remote server
Sep 30, 2022
88770d4
Add token wrap support for remote server
Sep 30, 2022
cd8a9cf
Update src/token/create.rs
Sep 30, 2022
5bb75a8
Update src/token/wrap.rs
Sep 30, 2022
72767e1
WIP -- invoke init_token when creating
Sep 30, 2022
52462ae
Merge commit 'e2c6d7a' into refac
leighmcculloch Sep 30, 2022
f8aa8fc
remove soroban prefix on things
leighmcculloch Sep 30, 2022
1c4b21a
Client
leighmcculloch Sep 30, 2022
38bf961
files
leighmcculloch Sep 30, 2022
9810a4c
Merge branch 'refac' into 81/deploy-token-contract
leighmcculloch Sep 30, 2022
91ef92c
Merge branch 'main' into 81/deploy-token-contract
leighmcculloch Sep 30, 2022
cf1caca
bump sdk and env revisions
Sep 30, 2022
141ca9f
try re-ordering fields?
Sep 30, 2022
92b1e96
Figure out token create init footprint
Sep 30, 2022
2539351
rustfmt
Sep 30, 2022
256d9ef
use new ScVal::AccountId
Sep 30, 2022
c5fca4a
rustfmt
Sep 30, 2022
88aed3a
Add footprint for token wrap txn
Oct 3, 2022
94a3f90
need to increment the account sequence
Oct 3, 2022
ab0d7d5
Merge branch 'main' into 81/deploy-token-contract
Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ csv = "1.1.6"
ed25519-dalek = "1.0.1"
jsonrpsee-http-client = "0.15.1"
jsonrpsee-core = "0.15.1"
regex = "1.6.0"

[patch.crates-io]
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "bc3ff723" }
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "fb658e3" }
stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "3c21b987" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "b20d10db" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "b20d10db" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "b20d10db" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "b20d10db" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "35f752b" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "35f752b" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "35f752b" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "35f752b" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "1bcc6fe3" }
wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "a61b6df" }

Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod rpc;
mod serve;
mod snapshot;
mod strval;
mod token;
mod utils;
mod version;
mod xdr;
Expand Down Expand Up @@ -39,6 +40,8 @@ enum Cmd {
Read(read::Cmd),
/// Run a local webserver for web app development and testing
Serve(serve::Cmd),
/// Wrap, create, and manage token contracts
Token(token::Root),
/// Deploy a WASM file as a contract
Deploy(deploy::Cmd),
/// Generate code client bindings for a contract
Expand Down Expand Up @@ -66,6 +69,8 @@ enum CmdError {
#[error(transparent)]
Serve(#[from] serve::Error),
#[error(transparent)]
Token(#[from] token::Error),
#[error(transparent)]
Gen(#[from] gen::Error),
#[error(transparent)]
Deploy(#[from] deploy::Error),
Expand All @@ -82,6 +87,7 @@ async fn run(cmd: Cmd, matches: &mut clap::ArgMatches) -> Result<(), CmdError> {
}
Cmd::Read(read) => read.run()?,
Cmd::Serve(serve) => serve.run().await?,
Cmd::Token(token) => token.run().await?,
Cmd::Gen(gen) => gen.run()?,
Cmd::Deploy(deploy) => deploy.run().await?,
Cmd::Xdr(xdr) => xdr.run()?,
Expand Down
1 change: 1 addition & 0 deletions src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ fn parse_transaction(
return Err(Error::Xdr(XdrError::Invalid));
};

// TODO: Support creating contracts and token wrappers here as well.
if body.function != HostFunction::InvokeContract {
return Err(Error::Xdr(XdrError::Invalid));
};
Expand Down
Loading