Commit Graph

168 Commits

Author SHA1 Message Date
samkim-crypto d6a72ebfe4
Add pubkey consistency check on account and proof data (#3767) 2022-10-27 12:40:26 +09:00
samkim-crypto 7a2702936d
remove transfer with fee instruction (#3766) 2022-10-27 10:26:33 +09:00
samkim-crypto 0c8fb24d47
upgrade solana-program to 1.14.6 (#3765) 2022-10-27 07:59:25 +09:00
Jon Cinque aaabce2035
token-2022: Return errors for malformed extension data (#3762) 2022-10-26 11:16:00 -04:00
Jon Cinque d331f47c52
token-2022: Remove redundant mint initialization check (#3763) 2022-10-26 11:15:32 -04:00
Jon Cinque 0ff8fe1546
token-2022: Error sooner when searching for an extension in TLV data (#3761) 2022-10-26 11:15:08 -04: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
Jon Cinque b45641f634
token-2022: Clarify `decode_instruction_data` (#3760) 2022-10-25 21:57:26 -04:00
Jon Cinque 8d79d85969
token-2022: Add unnecessary owner checks for more clarity (#3759) 2022-10-25 21:31:34 -04:00
samkim-crypto 12c11f6f9c
let error propagate instead of panicking (#3754) 2022-10-26 09:37:37 +09:00
samkim-crypto 02b1265ec8
fix minor test data description (#3752) 2022-10-26 09:37:04 +09:00
samkim-crypto bf10dfddf4
fix possible panic from short data length (#3751) 2022-10-26 09:36:46 +09: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 d02d49e267 fix comment, remove allow dead code 2022-10-17 16:09:41 -07:00
hanako mumei 3a87c8fc0a update solana to 1.14.4 2022-10-12 10:48:23 -07:00
timkoopmans 4e09bd54fb typo 2022-10-04 15:59:29 -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 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
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 b6259b3a51
token-2022: Add inverse fee calculation (#3524)
* token-2022: Add inverse fee calculation

* Rename functions
2022-08-30 17:56:34 +02: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
Jon Cinque 6e125f88a9
token[-2022]: Change `target_arch` to `target_os` (#3493) 2022-08-18 13:38:10 +02:00
Tyera Eulberg 3c54aecfe9
Bump solana to v1.10.35 (#3485) 2022-08-16 12:33:24 -06:00
Tyera Eulberg 5d03efbabe
Bump token-2022 to 0.4.3 (#3480) 2022-08-15 22:08:32 -06:00
Tyera Eulberg 7c6235d9e7
Bump token to v3.5.0 and ata to v1.1.1 (#3430) 2022-08-04 01:09:38 -06:00
Tyera Eulberg 4a56a4b840
Prep for spl-token v3.5.0 (#3426)
* check that unpack is tolerant of small sizes (#3416)

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

* Refactor hasty fix to match token-2022

* Make test exhaustive

* cargo fmt

Co-authored-by: Michael Vines <mvines@gmail.com>

* Readd proptests without losing unit test, #3421

Co-authored-by: anatoly yakovenko <anatoly@solana.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-04 00:25:07 -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
Jon Cinque d7f352bd78
token[-2022]: Add proptest for unpacking (#3421) 2022-08-03 20:01:08 +02:00
samkim-crypto c98609850f
token-2022: merge instruction data for confidential Transfer and TransferWithFee (#3410) 2022-08-03 12:15:31 +09:00
Tyera Eulberg c21b4ae24a
Bump spl-token-2022 to 0.4.2 (#3390) 2022-07-27 12:25:11 -06:00
Tyera Eulberg c00194d225
Bump solana crates to v1.10.33 (#3385) 2022-07-27 11:28:14 -06:00
Jon Cinque d3cbe360ac
token-2022: Refactor PrintProgramError impl to error file (#3366) 2022-07-24 21:28:09 +02:00
jon wong 024ba3ad41
token-2022: Bump version for 0.4.1 release (#3328)
* Bumping `spl-token-2022` version

* Bump Cargo.lock
2022-07-09 01:02:49 +02:00
omertxyz f30ad1d752
Add serde feature - token-2022 (#3291)
* Add serde to token-2022

* Add tests

* Fix feature syntax

* Formatting, enabling features

* Make CI work, and some naming nit cleanup

* Un-async tests

Co-authored-by: jon wong <j@jnwng.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-07-07 13:18:47 -04: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 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 f7abf4a6bc
token-2022: Remove `reallocate` and `sibling-instruction` features (#3213) 2022-06-01 16:46:41 +02: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
Michael Vines f1c693d067
token-2022: Add support for Non-Transferable Tokens (NTTs) - NonTransferableMint extension (#3178)
Co-authored-by: Juan Oxoby <me@jmoxo.by>
2022-05-17 16:16:13 -07:00