Commit Graph

2386 Commits

Author SHA1 Message Date
Alexander Ray 287c3bedaf
stake-pool-cli: Fix prepare_withdraw_accounts issues (#2548)
* - fix prepare_withdraw_accounts issues

* - use reverse fee as workaround for withdraw issue
2021-10-26 23:13:59 +02:00
Jon Cinque cd3f5ae9fe
stake-pool: Add test for withdrawing all, with fee (#2550) 2021-10-26 22:50:16 +02:00
Jon Cinque 8be3ba819c
stake-pool-docs: Add the published audits (#2546) 2021-10-26 22:30:16 +02:00
Jon Cinque 756696ee8e
stake-pool-cli: Add validator list argument to create (#2545)
People want to know more about the validator list, but there isn't too
much info provided.

* Include the validator list as an optional parameter to pool creation
* Print out the address during creation
* Always print out the address during `list`
* Add docs about it
2021-10-25 23:13:58 +02:00
Sebastian Bor d550f4f7e6
Governance: Flag payer account as writable on instructions creators (#2543) 2021-10-25 14:08:34 +01:00
Michael Vines fca9836a2c Avoid MemcmpEncodedBytes::Binary 2021-10-20 22:52:19 -07:00
Michael Vines e2a5785ad7 Revert "Revert once SPL updates to Solana 1.8.1"
This reverts commit f5767bb3e209b591c657ad5732ff854c635292a4.
2021-10-20 22:52:19 -07:00
Michael Vines 9acb082dc3 Upgrade to Solana v1.8.1 2021-10-20 22:52:19 -07:00
Jarry Xiao c8963e8348
Updating Stateless Offer to Optionally Include Fees (#2507)
* Updating Stateless Offer PDA seeds to only require main wallet and mint types

* Added optional payment of creator fees for NFTs

* Addressed formatting issues

* Fixed bugs in fee paying code, removed logs to lower compute limit

* Add in check to make sure the proper metadata is passed in

* Added workflow for taker posting NFT (maker pays fees)
2021-10-20 19:51:38 -05:00
Sebastian Bor ef72e56738
Governance: Use max_voting_time to determine proposal final state (#2529)
* feat: do not allow withdrawing votes before proposal is finalised

* feat: do not allow proposal cancellation before proposal is finalised

* chore: update comments and add test

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-20 20:48:02 +01:00
Jon Cinque 4ab60e6794
stake-pool: Also set the sol deposit authority on init (#2532) 2021-10-20 01:45:00 +02:00
Jon Cinque 675d65b965
stake-pool-cli: Add more docs around scripts (#2531) 2021-10-20 01:29:00 +02:00
Jon Cinque 203db7bc3f
stake-pool-cli: Improve deposit and withdraw UX (#2530) 2021-10-19 23:30:41 +02:00
Michael Vines c9a918f5cd Avoid `Hash`'s private parts, use `AsRef` instead 2021-10-19 09:11:56 -07:00
Jon Cinque c5e7ae736e
stake-pool: Add comment to validator stake info field (#2527) 2021-10-19 17:19:10 +02:00
Jon Cinque 1a48523a80
stake-pool: Remove copied stake program code (mostly) (#2526)
* stake-pool: Remove (mostly) the copied stake program

* Remove references to stake_program in CLI
2021-10-19 16:48:56 +02:00
Sebastian Bor d6d0b92ae7
Governance: Voter-weight-addin cleanup (#2512)
* chore: Ensure voter-weight-addin is built for tests

fix: build addin during test run

fix: build voter weight addin for tests using the addin only

chore: use mutex to build addin only once

chore: move build guard to separate file

chore: update governance version for chat

* chore: create tools crate for common utility functions in governance ecosystem

* chore: add test-sdk and tools readme

* chore: rename reserved addins to specific names

* chore: remove todo comment

* chore: remove unnecessary var drop

* chore: move all account tools to shared crate

* chore: fix chat compilation

* chore: move program_id to first position
2021-10-19 11:43:01 +01:00
Jon Cinque f95e390dd4
stake-pool: Clarify stake deposit fee (#2520) 2021-10-19 12:26:50 +02:00
Colin Ogoo 0a5e952485 fix: typo in comments
fix minimal typo in comment
2021-10-18 19:02:46 -06:00
Jon Cinque 3b48fa09d3
stake-pool: Cleanup documentation in code (#2525) 2021-10-19 01:50:35 +02:00
Jon Cinque 4658815e9f
stake-pool: Force pools to only use the SPL token program (#2521) 2021-10-19 01:39:57 +02:00
Jon Cinque 7f0278caa8
stake-pool: Add checked math to big vec calc (#2524) 2021-10-19 00:46:49 +02:00
Jon Cinque f97c61a9ed
stake-pool: Initialize all pool fields explicitly (#2523) 2021-10-19 00:46:39 +02:00
Jon Cinque 50b5597fcf
stake-pool: Improve error when overdrawing on decrease (#2522) 2021-10-19 00:45:46 +02:00
Alexander Ray 671590dd05
- reimplement prepare_withdraw_accounts according to the documentation (#2513)
* - reimplement prepare_withdraw_accounts according to the docu

* - add preferred withdraw validator

* - fix clippy issues

* - fix styling
2021-10-15 22:35:44 +02:00
Sebastian Bor e8b7009cc4
Governance: Add UI section to readme (#2511) 2021-10-13 21:38:04 +01:00
Michael Vines 647129c612 Revert once SPL updates to Solana 1.8.1 2021-10-13 12:45:21 -07:00
Michael Vines 18543cf352 Adapt to retyping of HEAP_START_ADDRESS from usize to u64 2021-10-13 12:45:21 -07:00
Sebastian Bor dc7f6be034
Governance: Add deposit amount (#2485)
* feat: add amount to Deposit instruction

* feat: use try_from_slice_unchecked to support forward compatibility

* chore: make clippy happy

* chore: update comments
2021-10-13 19:59:30 +01:00
fukaoi 5436ac239e
added transferChecked (#2481) 2021-10-13 16:55:19 +02:00
Krešimir Klas 889ccd6799
[token][js]: add missing checked instruction method declarations to module.d.ts (#2484)
The following methods:
- createApproveCheckedInstruction
- createMintToCheckedInstruction
- createBurnCheckedInstruction
- createSyncNativeInstruction

are missing from the `module.d.ts` file which means they won't be included in
the `lib/index.d.ts` module declaration file and therefore cannot be
referenced to when using the package with typescript.

Added the missing declarations.
2021-10-13 16:54:56 +02:00
Sebastian Bor c99f4195f1
Governance: Voters weights add-in (#2450)
* feat: setup and configure voter weight addin

feat: add use_voter_weight_add_in flag to realm config

chore: use spl-governance 1.1.1 version

chore: make clippy happy

chore: add test to deserialise v1 CreateRealm instruction from v2

feat: add voter-weight-addin skeleton project

chore: build voter-weight-addin before governance

fix: temp workaround to make spl_governance_voter_weight_addin available in CI

chore: add tests with voter-weight-addin

feat: implement deposit instruction for voter weight addin

feat: add voter_weight_expiry

fix: set voter_weight_expiry

chore: restore positive execute tests

chore: restore ignored tests

wip: pass voter weight accounts to create_account_governance2

wip: read voter weight account

chore: make clippy happy

wip: add realm and validation to voter_weight deposit

fix: update addin

chore: make clippy happy

chore: fix voter_weight_record names

feat: use voter weight provided by addin when governance created

chore: update addin

chore: remove governance stake pool program

feat: remove time offset from revise

chore: fix build

feat: create RealmAddins account when realm with addin is created

chore: make clippy happy

feat: set voter weight addin using SetRealmConfig instruction

chore: make clippy happy

chore: update comments

chore: reorder SetrealmConfig accounts

chore: infer use_community_voter_weight_addin

chore: infer use_community_voter_weight_addin

chore: update voter weight addin comments

feat: use voter weight addin id from RealmAddins account

* feat: use voter weight addin to create proposal

* feat: use voter weight addin to cast vote

* chore: make clippy happy

* feat: use voter weight addin to create token governance

* feat: use voter weight addin to create mint governance

* feat: use voter weight adding to create program governance

* chore: create assert_can_withdraw_governing_tokens() helper function

* chore: fix compilation

* fix: ensure governance authority signed transaction to create governance

* feat: implement CreateTokenOwnerRecord instruction

* chore: fix chat tests

* chore: update comments

* chore: rename RealmAddins account to RealmConfig account

* chore: add more reserved space to GovernanceConfig account

* chore: update instruction comments

* chore: update comments

* chore: fix compilation

* chore: remove ignore directive for tests

* feat: panic when depositing tokens into a realm with voter weight addin

* chore: rename community_voter_weight to community_voter_weight_addin

* feat: make payer account optional for SetRealmConfig
2021-10-13 13:15:22 +01:00
Michael Vines 1c417ffa4f Fork Token 2022 program 2021-10-12 10:43:58 -07:00
Michael Vines 12732f8d5a Upgrade to Solana 1.8.0 2021-10-12 09:40:06 -07:00
Jon Cinque f630d71fdc
stake-pool-cli: Bump version to 0.6.2 (#2501) 2021-10-12 00:29:38 -04:00
Jon Cinque b8cc6fa12c
stake-pool-cli: Fix funding authority flag name (#2500) 2021-10-12 00:04:35 -04:00
joeaba 3cf123312e
adding PR target 2021-10-11 15:27:03 +05:30
joeaba c1ae9d34a2
turning off travis.yml by changing its formate from yml to txt so that it can't get triggered on travis 2021-10-11 11:19:29 +05:30
Jarry Xiao 290833e76d
Building on top of Toly's PR, v1 compiles (#2476)
* Building on top of Toly's PR, v1 compiles

* formatting

* minor architecture changes and comments

* more formatting

* refactor of processor

* Might pass formatting now; TODO add native token logic

* Comment typos

* clippy

* order swap

* changed the ordering of some print statements

* modified source code to transfer SOL directly in the case that the taker mint is equal to Native SOL

* formatting

* Explicitly check for delegate in the source code

* formatting

* Added debug logs to test client, fixed some lingering bugs

* Clippy
2021-10-09 16:16:49 -05:00
axleiro 4a45f4a896
Update spl_action.yml 2021-10-09 18:12:42 +05:30
joeaba 5be914885e
adding spl_action.yml 2021-10-09 13:40:40 +05:30
dependabot[bot] df959d0605
build(deps-dev): bump flowgen from 1.14.1 to 1.15.0 in /token-swap/js (#2492)
Bumps flowgen from 1.14.1 to 1.15.0.

---
updated-dependencies:
- dependency-name: flowgen
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 10:15:57 +00:00
Jon Cinque 13375afff2
stake-pool: Add last epoch values for APR calculation (#2491)
* stake-pool: Add last epoch values for APR calculation

* Bump versions for release
2021-10-07 00:01:15 -04:00
dependabot[bot] 06563bf879
build(deps-dev): bump @types/node in /token-lending/js (#2488)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.2 to 16.10.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-06 09:19:39 +00:00
Jon Cinque 3d52925865
stake-pool: Bump version for 0.6.0 release (#2487) 2021-10-06 00:11:20 -04:00
Jon Cinque b80c10f406
stake-pool: Add withdraw-sol command + CLI + docs (#2475)
* stake-pool: plumb sol withdraw fee and authority

* Add sol withdraw instruction and processor

* Cleanup sysvar usage

* Fix stack size violation

* Add tests

* Add CLI support

* Add docs for new command

* Integrate review feedback
2021-10-05 22:44:03 -04:00
dependabot[bot] 28adc9656b
build(deps-dev): bump @typescript-eslint/eslint-plugin (#2483)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.32.0 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-05 09:17:16 +00:00
dependabot[bot] 2cc7a01679
build(deps-dev): bump @typescript-eslint/parser in /token-lending/js (#2482)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.32.0 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-05 09:17:06 +00:00
dependabot[bot] c371995c86
build(deps-dev): bump typedoc from 0.22.4 to 0.22.5 in /token-lending/js (#2480)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.4 to 0.22.5.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.4...v0.22.5)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-04 09:18:16 +00:00
dependabot[bot] 1b5b891594
build(deps-dev): bump @rollup/plugin-commonjs in /token-lending/js (#2479)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 20.0.0 to 21.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v21.0.0/packages/commonjs)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-commonjs"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-04 09:16:52 +00:00