Commit Graph

1436 Commits

Author SHA1 Message Date
Christian Machacek 18d96ffce6 Fix cross-program-invocation C example
Correctly check if deriving the PDA with the given seed was successful.
Don't pass the system program pubkey to the allocate instruction: the first account passed must be the one to be allocated.
2021-05-08 09:58:39 -07:00
jordansexton f0b1cec4d8 stake-pool: minor typo fix 2021-05-07 13:50:35 -05:00
dependabot[bot] cfc6c582ff
build(deps): bump lodash from 4.17.19 to 4.17.21 in /token-swap/js (#1674)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:55:28 +00:00
dependabot[bot] 090ecefa46
build(deps): bump lodash from 4.17.20 to 4.17.21 in /token-lending/js (#1672)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:14:28 +00:00
Trent Nelson 9482f8d4e3 token/js: Bump version to v0.1.4 2021-05-07 06:39:04 +00:00
jordansexton 1526301d0d ran cargo fmt 2021-05-06 23:32:14 -05:00
Leonard G 3045d7b1df
Flashloan for token lending (#1444)
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
Co-authored-by: Jordan Sexton <jordan@jordansexton.com>
2021-05-06 23:27:41 -05:00
dependabot[bot] ea4b7e62fc
build(deps-dev): bump @typescript-eslint/eslint-plugin in /token/js (#1669)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.17.0 to 4.22.1.
- [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.22.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 10:51:41 +00:00
dependabot[bot] 51cc3ed6fe
build(deps): bump @babel/runtime from 7.13.10 to 7.14.0 in /token/js (#1668)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.13.10 to 7.14.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.0/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 10:15:04 +00:00
dependabot[bot] 9aa238e0b4
build(deps-dev): bump @rollup/plugin-node-resolve in /token/js (#1667)
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 11.2.0 to 13.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v13.0.0/packages/node-resolve)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:40:44 +00:00
Michael Vines 00eb817073
Update token.md 2021-05-05 21:06:48 -07:00
dependabot[bot] 4e1892adba
build(deps-dev): bump dotenv from 8.2.0 to 9.0.0 in /token-lending/js (#1666)
Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v8.2.0...v9.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 00:07:46 +00:00
dependabot[bot] 3714c70d12
build(deps): bump @solana/web3.js in /token-lending/js (#1665)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.9.0...v1.9.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 23:33:23 +00:00
dependabot[bot] a05fd7185d
build(deps-dev): bump @types/node in /token-lending/js (#1664)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 22:58:30 +00:00
dependabot[bot] cf2fcde121
build(deps-dev): bump @typescript-eslint/eslint-plugin (#1663)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.22.0 to 4.22.1.
- [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.22.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 22:22:49 +00:00
Trent Nelson 3d04aa0109 chore: add negative test for ATA creation with off-curve owner 2021-05-05 15:48:59 -06:00
Trent Nelson 7320cf404b fix: reject off-curve owners during ATA creation 2021-05-05 15:48:59 -06:00
Trent Nelson 975b524487 chore: bump solana web3 to v1.9.1 2021-05-05 15:48:59 -06:00
Michael Vines a539ef021f Explicitly call out the --decimals argument to `spl-token create-token` 2021-05-05 08:47:55 -07:00
Jon Cinque 1efc90c5c9
stake-pool: Update docs for all new features (#1651)
The stake pool program changed a lot, but the docs did not.  Bring them
up to speed!
2021-05-05 16:14:24 +02:00
dependabot[bot] 0ce5b41b9f
build(deps-dev): bump @typescript-eslint/parser in /token-lending/js (#1661)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.22.0 to 4.22.1.
- [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.22.1/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 09:41:51 +00:00
Trent Nelson 1f36ca301b Bump solana crates to v1.6.7 2021-05-05 04:39:49 +00:00
Michael Vines 4068b77f53 Add name service to sidebar 2021-05-04 10:20:01 -07:00
Solana Maintainers 512497aa39 use cleanup 2021-05-04 10:12:05 -07:00
Solana Maintainers d9fd11a8f3 Add program id 2021-05-04 10:12:05 -07:00
dependabot[bot] 9e4764faf7
build(deps-dev): bump rollup from 2.46.0 to 2.47.0 in /token-lending/js (#1658)
Bumps [rollup](https://github.com/rollup/rollup) from 2.46.0 to 2.47.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.46.0...v2.47.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-04 09:36:09 +00:00
Lcchy 0ed080a50f
Add name-service program and js bindings (#1600) 2021-05-04 00:07:11 +00:00
Jon Cinque 3dd6767297
stake-pool: Update versions for crate deployment (#1657) 2021-05-03 20:50:49 +00:00
dependabot[bot] b99c9b375c
build(deps): bump @solana/web3.js in /token-lending/js (#1655)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.7.1 to 1.9.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.7.1...v1.9.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 11:24:25 +00:00
Jon Cinque 9c63bc0b06
stake-pool-cli: All sorts of fixes (#1650)
While going back through the docs, I ended up doing a lot of the stake
pool CLI items:

* Deposit / withdraw command: Use associated token account by default
* Create command: Allow passing the stake pool and mint keypair (useful
  for testing)
* Create command: Split the transaction for pool creation (required to get under the
  transaction size limit)
* Add / remove validator command: take a validator vote account rather than stake
  account, which makes integration from outside tools a lot simpler
* Update command: add a `--force` flag to force the update
* Update command: add a `--no-merge` flag to not merge while updating
  (useful to allow the pool to work, even if the transient stake
  accounts are unmergeable)
* Withdraw: Add `--use-reserve` flag to withdraw from reserve
* Withdraw: Add `--vote-account` arg to specify which validator to
  withdraw from
2021-05-03 11:47:24 +02:00
dependabot[bot] 5a357a50df
build(deps): bump @solana/web3.js in /token-lending/js (#1648)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.7.0...v1.7.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:48:42 +00:00
Jon Cinque 0f4f2b8de9
token-swap: Fix slippage on withdraw tokens (#1637)
* token-swap: Fix withdrawal all tokens slippage

When withdrawing, the slippage check is done before `min`ing the token a
and b amounts, which makes it possible to ignore the desired slippage,
and lose out on a lot more than expected.

This has an additional knock-on effect. When burning all of the pool
tokens, it becomes impossible to ever use it again.

* Check for slippage after getting the actual amount that would be
  traded
* Re-initialize the pool token amount on the next deposit if all pool
  tokens were burned

Fixes #1629

* Fmt + clippy

* Deposit one side on 0 pool tokens just gives new supply back
2021-04-29 14:26:47 +02:00
dependabot[bot] 60ef11e26b
build(deps-dev): bump rollup from 2.45.2 to 2.46.0 in /token-lending/js (#1644)
Bumps [rollup](https://github.com/rollup/rollup) from 2.45.2 to 2.46.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.45.2...v2.46.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 09:51:59 +00:00
Jordan Sexton 5e320ba976
lending: cross collateral / cross liquidity support (#1441) 2021-04-28 20:55:33 -05:00
dependabot[bot] 636407d7a9
build(deps-dev): bump @types/node in /token-lending/js (#1642)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.0 to 15.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 09:41:15 +00:00
Jon Cinque 11e207cc85
stake-pool: Add user transfer authority on withdraw (#1640)
The stake pool expects pool tokens to be delegated to the withdraw
authority before performing a withdrawal. If a user delegates too many
tokens to the withdraw authority, anyone else can take the rest of their
tokens by doing their own withdrawal.

Delegate pool tokens to an ephemeral keypair and sign with that.
2021-04-27 12:53:46 +00:00
Jon Cinque 14bdbdc3ac
stake-pool: Add ability to remove a validator that has deactivating transient stake (#1624)
* Add status enum

* Add ability to remove validator with transient stake

* Only account validator stake if active

* Fix merge conflicts
2021-04-27 13:24:39 +02:00
dependabot[bot] 7d666b86ce
build(deps): bump @solana/web3.js in /token-lending/js (#1639)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.5.0 to 1.7.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.5.0...v1.7.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:36:21 +00:00
dependabot[bot] 81ab529311
build(deps-dev): bump @types/node in /token-lending/js (#1638)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.41 to 15.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:35:28 +00:00
Tyera Eulberg c9a5289aa0
Add airdrop help to token docs (#1636) 2021-04-26 20:51:43 +00:00
Jon Cinque ca6d57991a
token-swap js: Fix arg list in ts / flow (#1633) 2021-04-26 20:21:25 +00:00
Tyera Eulberg 99aaab0993
docs: specify mint in spl-token balance examples (#1634) 2021-04-26 20:20:16 +00:00
dependabot[bot] 1e28a427a4
build(deps-dev): bump eslint from 7.24.0 to 7.25.0 in /token-lending/js (#1631)
Bumps [eslint](https://github.com/eslint/eslint) from 7.24.0 to 7.25.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.24.0...v7.25.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 11:09:53 +00:00
Jon Cinque 61a53abf6f
stake-pool: Add ability to withdraw from reserve if no stake available (#1627) 2021-04-23 23:55:16 +02:00
Michael Vines 1e47030549 Update SPL to Solana v1.6.6 2021-04-23 13:39:51 -07:00
Trent Nelson 9ad4168253
token-cli: bump version to 2.0.11 2021-04-23 01:53:28 -06:00
Trent Nelson dfc5cc5a23 token-cli: Fix ATA creation in offline mode 2021-04-23 07:42:45 +00:00
Jon Cinque c149b0a46e
stake-pool: Add depositor key on init, required on deposit (#1616)
* stake-pool: Add depositor key on init, required on deposit

Some stake pools need to be private, and not allow outside depositors.

Enhance the existing deposit authority in the stake pool be configurable
on initialization, and then require its signature on deposit.

The existing deposit authority is a program address, making deposits
permissionless. This allows a pool creator to set their own deposit_authority on
initialization. In a great turn of events, almost everything else works
the same way!

Here's the current workflow for deposit, where the user calls
stake_program::authorize and stake_pool::deposit in the same
transaction:

* stake_program::authorize assigns staker and withdraw authority to the
  stake pool deposit authority
* stake_pool::deposit
    - uses the deposit authority to assign authority on the deposited
  stake account to the stake pool withdraw authority
    - uses the withdraw authority to merge the deposited stake into the validator stake

The deposit authority must "sign" the transaction in order to reassign
authority to the withdraw authority. Currently, as a program address, it
can just do that. With this change, if the deposit authority is set
during initialization, then that deposit authority must sign the
instruction.

There's also a little update for ease-of-use to always do the
stake_program::authorize in the same transaction as stake_pool::deposit.
This way, in case someone tries to deposit into a forbidden stake pool, the
whole transaction will bail and their stake will stay as theirs.

* Address review feedback

* Fix rebase issues
2021-04-22 21:34:41 +02:00
Jon Cinque 804a61e558
stake-pool: Increase lower limit for increase-validator-stake (#1620)
* stake-pool: Increase lower limit for increase-validator-stake

* Update test amounts in line with limit
2021-04-22 20:49:30 +02:00
Jon Cinque 3613ffe3b0
hotfix: ignore tests that break with tip of 1.6 (#1622) 2021-04-22 12:30:47 +00:00