Commit Graph

76 Commits

Author SHA1 Message Date
Jon Cinque ae994afa3e
Update repo to `edition = "2021"` (#3900) 2022-12-13 23:46:26 +01:00
samkim-crypto bb404a6af5
update solana to 1.14.10 (#3872) 2022-12-06 12:59:00 +09:00
hanako mumei 0de5f7339a bump token-cli to 2.2 and token-client to 0.3 2022-11-21 12:41:53 -08:00
hanako mumei 3c4267be06 token-2022: bump version to 0.5 2022-11-21 09:29:18 -08:00
samkim-crypto 6725958c26
[token-2022] Enable confidential payments only feature (#3790)
* add allow_non_confidential_credits field

* add tests for disabling non-confidential transfers

* Apply suggestions from code review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* clarify comment wording

* Update token/program-2022/src/extension/confidential_transfer/processor.rs

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-11-17 13:10:21 +09:00
Jon Cinque 8d0a2e1000
token-2022: Add PermanentDelegate extension (#3725)
* token-2022: Add PermanentDelegate extension

* Address feedback

* Refactor getting permanent delegate

* Rename function

* More cleanup

* Fix ATA
2022-11-15 14:10:59 +01:00
Jon Cinque d50f2745f8
token-cli: Support transfer fee extension (#3792)
* token-cli: Add transfer fee to create-token

* Add `expected-fee` arg to transfer

* Add withdraw-withheld-tokens implementation

* Add optional `Harvest` call while closing account

* Add `set-transfer-fee` command

* Fix rebase issues
2022-11-11 19:16:51 +01:00
samkim-crypto abc77af1d9
Require pubkey validity proof when initializing confidential account (#3784) 2022-10-30 14:51:22 +09:00
samkim-crypto 0c8fb24d47
upgrade solana-program to 1.14.6 (#3765) 2022-10-27 07:59:25 +09:00
hanako mumei 836c9e67a6 token-2022: implement CpiGuard
(this is a reversion of a previous reversion of the original CpiGuard commit)
2022-10-25 19:31:15 -07:00
Trent Nelson 2c28eaa036
Revert "token-2022: implement CpiGuard (#3712)"
This reverts commit 126fb93be2.
2022-10-25 00:46:00 -06:00
hana 126fb93be2
token-2022: implement CpiGuard (#3712)
token-2022: implement CPI Guard

CPI Guard is an extension to block certain unsafe token operations from being done by programs through CPI
2022-10-24 18:36:57 -07:00
hanako mumei 88b147506d bump token-cli to 2.1.1 and token-client to 0.2.1 2022-10-12 10:48:23 -07:00
hanako mumei 3a87c8fc0a update solana to 1.14.4 2022-10-12 10:48:23 -07:00
hanako mumei 5f189d1fc0 bump token-client to 0.2.0 and token-cli to 2.1.0 2022-10-10 17:36:34 -07:00
hanako mumei 51f5e93e4e token-client: clean up useless temp vecs 2022-10-07 14:08:27 -07:00
hanako mumei a5a565b56c token-client: move decimals from Token methods to struct 2022-10-07 12:24:36 -07:00
hanako mumei 200b2acab4 token-cli: final fixes for client conversion 2022-10-06 17:33:34 -07:00
hanako mumei 2c6fbf7c67 token-cli: make gc transfer tokens from uncloseable
also change client transfer to use idempotent associated account instruction
2022-10-06 17:33:34 -07:00
hanako mumei 7847f35f1e token-cli: convert transfer to client 2022-10-06 17:33:34 -07:00
hanako mumei e6739b5bae token-cli: convert gc to client
add new client function empty_and_close_auxiliary_account which does what it says
also remove sign-only mode from command_close to permit client close behave more sensibly
2022-10-06 17:33:34 -07:00
hanako mumei 186303a9d2 token-cli: convert create_multisig to client 2022-10-06 17:33:34 -07:00
hanako mumei 7e3a62473b token-client: convert extended functions to new interface
covers all extensions except confidential transfers
2022-10-06 17:33:34 -07:00
hanako mumei 2ae2a6bdf3 token-cli: test --immutable, final cleanups 2022-09-21 10:37:53 -07:00
hanako mumei 5756e7f9b7 token-cli: convert unwrap and sync_native to client
also allow client to control its own nativeness (nativity?)
2022-09-21 10:37:53 -07:00
hanako mumei 953e06b3a2 token-client: support wrap
also convert cli to use client for wrap
2022-09-21 10:37:53 -07:00
Jon Cinque f97a3dc7cf
clippy: Deny integer arithmetic, add allows where needed (#3606) 2022-09-15 13:16:53 +02:00
samkim-crypto 7633f6f81d
token-2022: Add support for non transferable and immutable ownership in token client (#3582)
* add token client support for non transferable mint

* resolve conflict

* add basic tests for non transferable token account

* add test for fees for non-transferable accounts

* resolve test failure from rebase
2022-09-14 17:37:09 +09:00
samkim-crypto 4587da1eab
confidential-extension: Restrict deposit source and withdraw dest to base accounts (#3540)
* resolve conflict

* update token client for new deposit syntax

* resolve conflict

* update tests

* address doc comments
2022-09-14 16:22:52 +09:00
Jon Cinque 49a119b105
token-client: Add fmt::Display implementation to RpcClientResponse (#3594)
* token-client: Add Display to RpcClientResponse

* Handle crates defined as `{ version = "...", ... }
2022-09-12 22:09:55 +02:00
Jon Cinque 6bcd051d38
token-client: Change create_account to return T::Output (#3584) 2022-09-10 16:01:50 +02:00
hanako mumei 4dfd23e0b6 token-client: memo now explicitly declares signers 2022-09-07 18:17:54 -07: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 b91972debb token-cli: use token client for freeze/thaw/revoke 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
hana e03a013184
token-cli: support `MintCloseAuthority` (#3487)
* cli: add --enable-close flag to create-token which sets its close authority to mint authority
* cli: add support to changing a mint close authority to authorize
* cli: add close-mint, a new command for closing a mint
* cli: update authorize and close-account to go through the token client
* client: change set_authority and close_account to support multisigners
2022-08-23 15:54:10 -07:00
hanako mumei c426ed9749 Refactor create-token to go through token client
* cli: remove offline args from commands that create accounts
* cli: implement finish_tx, to be a replacement for handle_tx, which branches on the client return
* client: validate a transaction is fully signed before sending over rpc
* client: convert payer from Signer to Arc<dyn Signer> to support cli signers
* client: support nonce mode
* client: change create_mint to be an object method that returns SendTransaction::Output
* client: rename S2 to S everywhere that Token<T, S> is Token<T>
2022-08-18 17:35:55 -07:00
hana 65769ce23d
Update rust to 1.60, solana to 1.11.6 (#3492)
also change bpf to sbf throughout the codebase

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-18 12:16:02 -07:00
Tyera Eulberg 3c54aecfe9
Bump solana to v1.10.35 (#3485) 2022-08-16 12:33:24 -06:00
hanako mumei 2ea6dfa1de token-cli: let clients return signature or txn 2022-08-15 16:06:50 -07:00
hanako mumei c5caba0d63 token-cli: use program_client for blockhash 2022-08-15 16:06:50 -07:00
Jon Cinque 3d42786e6e token-cli: Add no-op client 2022-08-15 16:06:50 -07:00
Jon Cinque f5ce86d43d
token/ata: Bump versions to 3.4.0 and 1.1.0, respectively (#3427) 2022-08-04 01:03:04 +02:00
Tyera Eulberg c00194d225
Bump solana crates to v1.10.33 (#3385) 2022-07-27 11:28:14 -06:00
samkim-crypto 937b64da37
Adjust confidential token rust client for offline signing (#3347)
* token-2022: remove account balance decryption from confidential transfer rust client

* token-2022: remove account balance decryption from withdraw withheld tokens from accounts

* token-2022: cargo fmt

* token-2022: update tests for new rust client syntax

* token-2022: cargo fmt

* token-2022: cargo clippy

* token-2022: minor
2022-07-16 05:34:19 +09:00
samkim-crypto 3afe1e652b
Derive elgamal key in token client (#3308)
* token-2022: derive elgamal key in token client

* token-2022: update program tests for key derivation

* token-2022: key derivation for apply pending balance

* token-2022: add configure account with max pending balance

* token-2022: update tests for apply pending balance

* token-2022: derive key for confidential trasfer with fee

* token-2022: update test for confidential transfer with fee

* token-2022: derive encryption keys for withdrawing withheld tokens

* token-2022: update tests
2022-07-04 15:47:33 +09:00