Commit Graph

80 Commits

Author SHA1 Message Date
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
samkim-crypto edac3c50f0
Disable confidential transfer tests (#3786)
* disable confidential transfer tests

* featurize additional parts of the code
2022-10-31 11:53:12 +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 7847f35f1e token-cli: convert transfer to client 2022-10-06 17:33:34 -07:00
hanako mumei 37168db058 token-cli: convert required memos and interest rate 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
samkim-crypto 50abadd819
token-2022: integrate memo into confidential extension (#3587)
* resolve conflict

* add test for confidential extension with memo

* add test for confidential transfer with memo

* change proof instruction order for memo

* resolve conflict

* minor

* rename new_with_memo to new_with_required_memo_transfers

* fix failing tests due to rebase

* fix failing tests due to rebase
2022-09-26 12:27:44 +09: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 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 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 ffbab71d49
token-2022: Use updated generic types for Token client in confidentials (#3546) 2022-08-29 23:27:29 +02: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
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
Jon Cinque 4fadd553e1
token: Reassign and reallocate accounts on close (#3415)
* token: Reassign and reallocate accounts on close

* Revert "Refactor unpack and make test more robust (#3417)"

This reverts commit c618de374e.

* Revert "check that unpack is tolerant of small sizes (#3416)"

This reverts commit 22faa05f18.

* Also revert d7f352bd78
2022-08-03 23:49:36 +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
Jon Cinque c1ee6a58be
Update Solana crates to 1.10.29 (#3303) 2022-07-01 16:51:01 -04:00
samkim-crypto 57c5fd80f6
token-2022: check destination accounts on confidential token tests (#3281)
* token-2022: check destination accounts on confidential token tests

* token-2022: cargo clippy
2022-06-21 23:59:26 +09:00
samkim-crypto c3137af9df
token-2022: add tests for withdraw of confidential withheld tokens from accounts (#3280)
* token-2022: add tests for withdraw of confidential withheld tokens from accounts

* token-2022: cargo fmt

* token-2022: cargo clippy
2022-06-21 22:02:15 +09:00
samkim-crypto 0f316fb357
bump solana to v1.10.26 (#3274) 2022-06-20 09:55:49 +09:00
Jon Cinque 27014732dd
token-2022: Bump version for next release (#3239) 2022-06-10 22:38:33 +02:00
samkim-crypto 677acf173d
token-2022: limit incoming transfers for confidential transfer extension (#3208)
* token-2022: limit incoming transfers for confidential transfer extension

* token-2022: add maximum pending counter for confidential extension in client

* token-2022: update tests for ct configure account

* token-2022: cargo fmt

* divide pending balance into lo and hi

* token-2022: update ct processor for lo and hi pending balances

* token-2022: limit confidential transfer deposit and transfer amount in token client

* token_2022: rename TokenError::IllegalAmount

* token-2022: compare max pending credit as u64

* token-2022: fmt

* token-2022: minor fix error from rebase

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

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

* token-2022: update configure account initialization comments

* token-2022: use strict comparison for max pending balance credit counter check

* token-2022: update deposit tests to check `pending_balance_hi` populated

* token-2022: update deposit tests to check that deposit and transfer fails when max pending exceeded

* token-2022: reset pending balance counter on `ApplyPendingBalance`

* token-2022: fix cargo test cases for credit counter

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-06-07 23:16:46 +09:00
samkim-crypto c2a3ecd970
token-2022: prevent an already configured confidential account to be configured again (#3216)
* token-2022: prevent an already configured confidential account to be configured again

* token-2022: add overwrite flag to init extension

* token-2022: clippy

* token-2022: update initialize mint for interest bearing mint

* token-2022: confidential transfer mint init allow overwrite
2022-06-07 09:42:23 +09:00
Jon Cinque 773e2ee469
token-2022: Add interest-bearing extension (#3013)
* token-2022: Add interest-bearing extension

* Rename / comment feedback

* Rename interest-bearing -> interest-bearing mint
2022-06-01 16:46:30 +02:00
samkim-crypto 424c900345
bump solana to v1.10.19 (#3195)
* bump solana to v1.10.19

* update solana-version.sh
2022-05-25 08:40:30 +09:00
samkim-crypto 2ad468f8b7
Fix confidential self transfer with fees (#3193)
* token-2022: fix confidential self-transfers with fee

* token-2022: update tests for confidential self-transfer with fees
2022-05-24 19:19:19 +09:00
samkim-crypto b2077609d9
token-2022: add tests for confidential transfer withdraw withheld tokens from mint (#3181) 2022-05-19 11:12:00 +09:00
Dmitri Makarov f1c1d440e9
Bump solana to v1.10.15 (#3176) 2022-05-17 11:27:30 -07:00
samkim-crypto 9e029349fc
Rename encryption pubkey (#3147)
* token-2022: change elgamal pubkey to encryption pubkey

* token-2022: update client and tests for  elgamal pubkey to encryption pubkey
2022-05-08 12:51:18 +09:00
samkim-crypto b6eb64b0b4
token-2022: check pending and available balance on confidential token tests (#3145)
* token-2022: check pending and available balance on confidential token tests

* token-2022: cargo fmt
2022-05-07 15:00:58 +09:00