Commit Graph

2770 Commits

Author SHA1 Message Date
hanako mumei 4dfd23e0b6 token-client: memo now explicitly declares signers 2022-09-07 18:17:54 -07:00
hanako mumei 8e6caf45ac token-cli: new config function get_account_checked
this replaces all instances of rpc_client.get_account -> check_owner
also we convert from rpc_client to program_client to further enforce offlineness
2022-09-07 14:36:39 -07:00
hanako mumei d2c33e26a4 token-cli: infer program_id based on cli args 2022-09-07 14:36:39 -07:00
hanako mumei 191977e2c6 token-cli: normalize argument names/descriptions
we now strictly adhere to the pattern:
* positional arg named `token`: a mint, described `TOKEN_MINT_ADDRESS`
* positional arg named `account`: an account, described `TOKEN_ACCOUNT_ADDRESS`
* positional arg named `address`: a mint or account, described `TOKEN_ADDRESS`, or a multisig, described `MULTISIG_ACCOUNT_ADDRESS`
* `--address` flag, named `address`: an account, described `TOKEN_ACCOUNT_ADDRESS`

normalize burn, unwrap, and supply to follow this convention
2022-09-07 14:36:39 -07:00
samkim-crypto fb0e6572a7
token-2022: add calculate post and pre fee amounts (#3570)
* add calculate post and pre fee amounts

* fix typo

* Update token/program-2022/src/extension/transfer_fee/mod.rs

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

* provide more info on ceiling division

* update tests

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-09-07 21:08:12 +09:00
samkim-crypto 30870c96e8
confidential-extension: forbid confidential transfer if nontransferable mint (#3542)
* forbid confidential transfer if nontransferable mint

* add a note about nontransferable mint in the transfer instruction

* disable deposit and withdraw if mint nontransferable
2022-09-07 09:40:28 +09:00
Jon Cinque 8ca2b8666b Add docs 2022-09-07 01:56:17 +02:00
Jon Cinque 8a3a6ebf60 Step 2: Add processor check to prevent a mint close authority 2022-09-07 01:56:17 +02:00
Jon Cinque 482656bb66 Step 1: Add a failing test with mint close authority 2022-09-07 01:56:17 +02:00
Jon Cinque bb468d2ce7 Step 2: Calculate the expected transfer fee 2022-09-07 01:56:17 +02:00
Jon Cinque 9abaf9c90d Step 1: Add a failing test using transfer fees 2022-09-07 01:56:17 +02:00
Alexandru Agache 668dcac11a
fix ConcurrentMerkleTreeHeader (de)serialization (#3572)
The `account_type` member of `ConcurrentMerkleTreeHeader` is currently
an `#[repr(u32)]` enum, but borsh only uses one byte to serialize or
deserialize an enum tag, which leads to issues with `try_from_slice`
calls that get passed slices computed based on applying `size_of` to
`ConcurrentMerkleTreeHeader`. This commit replaces the underlying
type of `account_type` with an integer type.

Signed-off-by: Alexandru Agache <alexandruag@gmail.com>

Signed-off-by: Alexandru Agache <alexandruag@gmail.com>
2022-09-06 18:28:50 -05:00
Dana aadf29e563
docs: Use new overload of confirm tx in token-2022 extension examples (#3567) 2022-09-06 19:07:46 +02:00
ngundotra 7c7507f4ec AC: downgrade solana program version in wrapper to reduce dependency burden 2022-09-01 19:48:43 -04:00
Jon Cinque 592960c2de Add documentation 2022-09-01 20:12:12 +02:00
Jon Cinque 3419482741 Update fuzz and JS clients for new interface 2022-09-01 20:12:12 +02:00
Jon Cinque deeb02deff Step 3: Change `transfer` to `transfer_checked` 2022-09-01 20:12:12 +02:00
Jon Cinque 1d27ca5ced Step 2: Add mints to instructions that use `transfer` 2022-09-01 20:12:12 +02:00
Jon Cinque 1b6173cb4e Step 1: Add transfer fee extension to Token-2022 tests 2022-09-01 20:12:12 +02:00
Jon Cinque 07d14e948a
fuzz: Update honggfuzz and rust version required (#3563) 2022-09-01 19:36:47 +02:00
samkim-crypto 7e2a048045
fix typo (#3559) 2022-09-01 09:06:57 +09:00
hanako mumei b9cab85d81 token-cli: final cleanups on client refactor
use mint for Token objects whenever possible, rework multisig_signers to be prettier
2022-08-31 13:57:41 -07:00
hanako mumei 5e494c63e0 token-cli: promote fee_payer to Arc<dyn Signer> 2022-08-31 13:57:41 -07:00
hanako mumei cf25381108 token-cli: use token client for approve 2022-08-31 13:57:41 -07:00
hanako mumei b91972debb token-cli: use token client for freeze/thaw/revoke 2022-08-31 13:57:41 -07:00
hanako mumei 46206fe64c token-cli: support memo on command_mint 2022-08-31 13:57:41 -07:00
hanako mumei db4a950ca8 token-client: convert freeze/thaw interface 2022-08-31 13:57:41 -07:00
hanako mumei 1fb05454e7 token-client: convert approve/revoke interface 2022-08-31 13:57:41 -07:00
hanako mumei b30aac80a6 token-client: convert transfer interface 2022-08-31 13:57:41 -07:00
hanako mumei 8e196e5e77 token-cli: use token client for command_burn 2022-08-31 13:57:41 -07:00
hanako mumei e540b172db token-cli: use token client for command_mint
* client: change mint_to to accept decimals and prefer mint_checked
* client: move multisig key winnowing into utility function
2022-08-31 13:57:41 -07:00
Jon Cinque 685e957ba9
token-swap: Remove stable swap (#3556) 2022-08-31 15:18:10 +02:00
Jon Cinque 180d80be7d
token-swap: Remove stable-swap simulation tests (#3555) 2022-08-31 14:34:25 +02:00
hanako mumei 8d1e57018a token-cli: finish interest bearing mint
minor cleanups, guards on set-interest-rate, impl set-authority for interest-bearing mints
2022-08-30 21:12:59 -07:00
Udbhav Muthakana fbae99fe2c token-cli: Support the InterestBearingMint extension 2022-08-30 21:12:59 -07:00
Jon Cinque 422544b906
ci: Re-enable twotx job (#3553)
* ci: Re-enable twotx job

* Remake patch file
2022-08-31 01:41:05 +02:00
Jon Cinque f0dd422f2a
stake-pool: Use stake program minimum delegation (#3547)
* stake-pool: Support dynamic minimum delegation amount

* Use minimum_delegation in CLI

* Address feedback

* Update minimum delegation in python test

* Address feedback

* Improve error message
2022-08-30 21:45:18 +02:00
Jon Cinque b4edc074a3
token-swap-js: Bump version for new release (#3552) 2022-08-30 21:23:56 +02:00
Jon Cinque b6259b3a51
token-2022: Add inverse fee calculation (#3524)
* token-2022: Add inverse fee calculation

* Rename functions
2022-08-30 17:56:34 +02:00
Jon Cinque ffbab71d49
token-2022: Use updated generic types for Token client in confidentials (#3546) 2022-08-29 23:27:29 +02:00
Andrii Tretyakov d65ab18fbd
token-cli: Removed usage of Account::LEN as a verificaton for token account (#3527)
replaced with Account::valid_account_data to support token2022
2022-08-29 12:42:33 -07:00
Jordan Sexton a578fc8159
add eslint-plugin-require-extensions (#3543) 2022-08-28 20:38:11 -05:00
Jon Cinque 90626fc4c9
ci: Update rust-nightly to 2022-04-01 (#3539)
* ci: Update rust-nightly to 2022-04-01

* Use rust_nightly parameter in fuzz script
2022-08-27 18:20:12 +02:00
Jon Cinque a04fa3ad08
ci: Bump lz4 for audit fix (#3541) 2022-08-27 17:04:00 +02:00
hanako mumei 84c566b13e bump token-cli to 2.0.17
release has already been made and lives in the `token-cli-v2.0.17-branch` branch
2022-08-25 17:54:38 -07:00
Noah Gundotra 3fe92ea05f
Add on-chain compression program that uses CMT (#3489) 2022-08-25 08:51:35 -10:00
hanako mumei 9382641da2 token-cli: remove #[allow(deprecated)] from toplevel
also remove ArcSigners temp code
2022-08-25 09:53:29 -07:00
Jordan Sexton d2b15ddc91 update spl-memo dependency 2022-08-24 19:04:27 -05:00
Jordan Sexton 65f5b102e8
spl-token: fix CJS imports (#3529)
* token-js: patch version bump

* add CJS package.json; fixes #3522

* alpha version bump

* remove alpha version

* add same postbuild step to memo js

* fix lockfiles
2022-08-24 19:01:19 -05:00
Athar Mohammad 2fe0ce60f8
[token-js] : Support for UiAmountToAmount and AmountToUiAmount instructions (#3345)
* suport for amountToUiAmount instruction

* support for uiamount to amount instruction

* upgrade @solana/web3.js to 1.47.4

* move amount.test from e2e-2022 to e2e

* fix and sort imports

Co-authored-by: Jordan Sexton <jordan@jordansexton.com>
2022-08-24 01:54:16 -05:00