Commit Graph

2675 Commits

Author SHA1 Message Date
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
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
Jordan Sexton 29d316e811
Fix Token program ESM exports (#3508)
* Fix Memo program ESM exports

* fix repository link

* Fix Token program ESM exports

* web3.js is a peer dependency

* memo/ts -> memo/js (same as token)

* add gh-pages dev dep

* add explicit js extensions

* use explicit js imports

* lint fixes for type imports

* fix version

* check in package-lock.json

* check in package-lock.json

* update spl-memo dep

* reorg imports

* move spl-memo to dev deps

* remove editorconfig

* update spl-memo

* update node version in CI

* memo and token use npm now

* use npm ci commands

* reorder imports
2022-08-22 19:07:03 -05:00
Sebastian Bor a179eba71e
Governance: Community Veto Vote (#3506)
* feat: Enable Community Veto Vote

* chore: test_veto_vote_with_community_voter_weight_addin

* chore: test_veto_vote_with_community_max_voter_weight_addin

* chore: assert valid community veto vote threshold

chore: Fix merge conflict
2022-08-23 02:03:29 +02:00
hanako mumei e06506b40b token-cli: dont push duplicates to bulk_signers 2022-08-22 16:28:43 -07:00
Jordan Sexton 48a859bbad
Fix Memo program ESM exports (#3507)
* Fix Memo program ESM exports

* fix repository link

* web3.js is a peer dependency

* memo/ts -> memo/js (same as token)

* add gh-pages dev dep

* fix version

* check in package-lock.json

* remove editorconfig
2022-08-22 17:57:25 -05:00
Sebastian Bor c5db9cec78
Governance: Explicit disabled weight thresholds (#3501)
* feat: enforce min_weight_to_create_governance Disabled value

* chore: test_create_proposal_with_community_disabled_error
2022-08-23 00:48:02 +02:00
Sebastian Bor 232406a9b4
Governance: Add council_vote_tipping (#3500)
* wip: Add council_vote_tipping

* feat: Use VoteTipping for relevant mint

* chore: test_cast_early_council_vote_with_disabled_community_vote_tipping

* chore: test_cast_community_vote_with_early_council_and_disabled_community_vote_tipping

* Update help text for `propose` (#3505)

* Governance: Use mint authority to revoke membership tokens (#3498)

* chore: fix process_revoke_governing_tokens feature

* feat: Use governing token mint authority to authorise token revocation

* chore: Fix authority spelling

* Governance: Do not tip on max vote weight when tipping Disabled (#3499)

* fix: Do not tip on max vote weight when tipping Disabled

* chore: test_cast_vote_with_strict_tipping_and_inflated_max_voter_weight_votes

* chore: fix test name


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

* wip: Add council_vote_tipping

* feat: Use VoteTipping for relevant mint

* chore: test_cast_early_council_vote_with_disabled_community_vote_tipping

* chore: test_cast_community_vote_with_early_council_and_disabled_community_vote_tipping

* chore: Fix merge conflicts

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-23 00:35:35 +02:00
Athar Mohammad 2198ee068b
Extends withdraw functionality in stake pool (#3445)
* extends withdraw to merge if stake account is provided

* check if account is stake account and delegated to same validator

* fixing tests and defining withdraw accounts for delegated stake reciever

* implementation improvements in cli

* fix js tests

* added test for uninitialized stake account
2022-08-22 23:36:13 +02:00
Sebastian Bor babf51941a
Governance: Do not tip on max vote weight when tipping Disabled (#3499)
* fix: Do not tip on max vote weight when tipping Disabled

* chore: test_cast_vote_with_strict_tipping_and_inflated_max_voter_weight_votes

* chore: fix test name


Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-22 21:58:05 +02:00
Sebastian Bor 10cf50ec2e
Governance: Use mint authority to revoke membership tokens (#3498)
* chore: fix process_revoke_governing_tokens feature

* feat: Use governing token mint authority to authorise token revocation

* chore: Fix authority spelling
2022-08-22 21:52:05 +02:00
Brooks Prumo 886d76016e
Update help text for `propose` (#3505) 2022-08-22 11:58:06 -04:00
Sebastian Bor 6dfc68db13
Governance: Council membership & plugins (#3344)
* chore: Use GovernanceTokenConfig

* wip: add council_token_config to RealmConfigAccount

* chore: update comment

* wip: use GoverningTokenConfigArgs for community token config

* chore: Change Proxy token type to Dormant

* chore: Update comments

* chore: Use GoverningTokenConfigAccountArgs for instructions creators

* chore: Use default  GoverningTokenType

* chore: Make community_token_args optional

* chore: Make Clippy happy

* chore: Update comments

* chore: Always create RealmConfigAccount

* chore: Set CouncilTokenConfig when realm is created

* feat: Update RealmConfigArgs in SetRealmConfig

* chore: Make Clippy happy

* chore: Assert RealmConfigAccount PDA

* wip: Use default RealmConfigAccount if the account doesn't exist

* chore: Remove use_community_voter_weight_addin and use_max_community_voter_weight_addin from RealmConfig

* chore: code review cleanup

* wip: Use voter weight addin for Council

* feat: Use max_voter_weight_plugin for Council

* feat: Impl RevokeGoverningTokens instruction

* chore: Make Clippy happy

* feat: Enforce governing token withdraw and deposit rules

* feat: Support minting deposits

* feat: Do not enforce token source owner for deposit validation

* chore: test_deposit_community_tokens_using_mint

* chore: Remove not implemented comment

* fix: Fix progrma id for resolving realm config for chat

* chore: Update instructions comments

* feat: Do not allow community Liquid token change to Membership

* chore: test_set_realm_config_with_liquid_community_token_cannot_be_changed_to_memebership_error

* chore: test_set_realm_config_for_community_token

* chore: use GoverningTokenConfig for test args

* chore: Refactor SetRealmConfigArgs

* chore: Update RealmSetupArgs names

* chore: test_set_realm_config_for_council_token_config

* chore: Revoke council tokens tests

* chore: test_revoke_council_tokens_with_realm_authority_must_sign_error

* chore: test_revoke_council_tokens_with_invalid_realm_authority_error

* chore: test_revoke_council_tokens_with_invalid_token_holding_error

* chore: RevokeGoverningToken tests

* chore: Dormant and Membership tokens tests

* chore: Using council plugin tests

* chore: RealmConfigAccount validation tests

* chore: Update Dormant token type configs

* fix: Reset legacy fields

* chore: Use Default macro for derivable defaults

* Chore: use assert functions to validate spl-token account and mint

* chore: Update Membership tokens comments

* chore: Pass governing_token_config_args as reference

* chore: Use single statement to return InvalidRevokeAmount error

* chore: Make Clippy happy - add derived Eq

Co-authored-by: Jon Cinque
2022-08-19 19:49:41 +02:00
Edgar 83b5dabf02
stake-pool: fix docstring typos (#3495)
fix typos
2022-08-19 18:57:32 +02: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
Jon Cinque 6e125f88a9
token[-2022]: Change `target_arch` to `target_os` (#3493) 2022-08-18 13:38:10 +02:00
Justin Malčić 8d88fb6c88
Add slippage constraint to borrow instruction (#3423)
* Add slippage limit to instruction

* Add slippage error

* Return error if below slippage limit

* Add tests

* Remove TODO

* Split instruction

* Fix test name

* Test limit case

* Update test

* Revert "Split instruction"

This reverts commit 3eba4942bd51f2402bf112edb514882636f0e401.

# Conflicts:
#	token-lending/program/tests/borrow_obligation_liquidity.rs

* Allow missing slippage_limit

* Fix limits

* Remove assertion
2022-08-17 15:58:04 +02:00
Justin Malčić e8bafb4b3f
Handle invalid fee account in `token-swap` (#3484)
* Add pool fee account checking

* Add checks for closed account

* Fix clippy warning

* Fix clippy warnings (again)

* Remove assertions
2022-08-17 15:56:43 +02:00
Jordan Sexton d6297495ea
token/js - make unpack functions consistent (#3486)
* make argument order and comments consistent for unpack functions

* add function to unpack multisig for parity

* update spl-memo version

* patch version bump

* run prettier

* fix comment

* update lockfile
2022-08-16 16:20:54 -05:00
Jon Cinque 10a70ddb3c
memo-ts: Make everything like token/js (#3479)
* memo-ts: Make everything like token/js

* Address feedback

* Update memo/js/README.md

* Update memo/js/README.md

Co-authored-by: Jordan Sexton <jordan@jordansexton.com>
2022-08-16 14:31:48 -05:00
Tyera Eulberg 3c54aecfe9
Bump solana to v1.10.35 (#3485) 2022-08-16 12:33:24 -06:00
Noah Gundotra d685fe1918
Introduce Concurrent Merkle Tree Implementation (#3455) 2022-08-16 10:54:37 -07:00
Tyera Eulberg 5d03efbabe
Bump token-2022 to 0.4.3 (#3480) 2022-08-15 22:08:32 -06:00
Jon Cinque d611db6a01
docs: Add token-2022 extension docs and JS examples (#3457)
* token-js: Add examples for all extensions

* docs: Add token-2022 extensions guide for JS

* Address feedback

* Fix extension
2022-08-16 01:07:21 +02: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 008809e8d6 Add docs for migrating a program to two token programs 2022-08-15 23:53:26 +02:00
Jon Cinque da27180b31 Fixup client bindings and otherwise 2022-08-15 23:53:26 +02:00
Jon Cinque 25556ce680 Step 4: Use appropriate token program 2022-08-15 23:53:26 +02:00
Jon Cinque e77efb3927 Step 3: Write tests using multiple token programs at once 2022-08-15 23:53:26 +02:00
Jon Cinque b13a7cab89 Step 2: Update instruction processors 2022-08-15 23:53:26 +02:00
Jon Cinque 16b441edb8 Step 1: Update all instruction interfaces 2022-08-15 23:53:26 +02:00
Pierre 730b628c57
token-js: expose unpack methods (#3471)
* feat: expose unpack methods

* default program id

Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
2022-08-15 15:30:51 +02:00
Jon Cinque d9a284f85f
toolchain: Pin repo to 1.59.0 using rust-toolchain.toml (#3466) 2022-08-12 16:59:23 +02:00
Jon Cinque 5050257541
ci: Disable twoxtx for now (#3460) 2022-08-11 23:42:23 +02:00
Jon Cinque 10addb2c16
ci: Add rocksdb to ignore audit (for now) (#3458) 2022-08-11 22:47:07 +02:00
Jon Cinque 6f2fc9965f
stake-pool: Bump versions to 0.7.0 (#3456) 2022-08-11 19:52:23 +02:00
samkim-crypto cccce80e65
Confidential transfer zk doc (#3437)
* docs: transfer and sigma proof discussions

* docs: add sigma proof notes

* docs: add transfer with fee notes

* docs: minor wording
2022-08-11 22:53:03 +09:00
Jon Cinque 1970356887
token-js: Version bump to 0.3.0 (#3448)
* token-js: Bump version 0.3.0 for release

* Improve README with support info
2022-08-09 18:54:46 +02:00
Jon Cinque 6b5e7cbbeb
token-js: Add reallocate instruction implementation (#3447) 2022-08-09 17:26:31 +02:00
Sumeet 3f25f59c96
Issue 2243 comments and source for system program instruction (#3439) 2022-08-09 17:10:57 +02:00
Justin Malčić cc2739fce1
token-cli: Clone signers (#3290)
* Switch to Arc

* Add temporary structs

To be removed upon upstream changes

* Get multisig signers earlier

* Build SignerFromPathConfig with multisig pubkeys

* Get default signer and address

* Store default signer and address

* Use stored default address

* Use stored default signer

* Avoid rereading signer for fee payer

* Clean up use statements

* Rename to ArcSigner

* Remove default_keypair

* Remove default_address

* Add comment for temporary newtype

* Refactor config

* Create config from args in tests

* Remove unused params

* Fix clippy warnings

* Fix rustfmt warnings

* Fix clippy warnings

* Move imports
2022-08-08 23:40:08 +02:00
Mike MacCana 3e104df32f Rename e to tokenAccount / error as appropriate 2022-08-08 16:16:32 +02:00
Jon Cinque b096cdecc1 Address feedback 2022-08-05 20:42:41 +02:00