Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add token docs #158

Merged
merged 3 commits into from
Jul 28, 2020
Merged

Add token docs #158

merged 3 commits into from
Jul 28, 2020

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Jul 28, 2020

First cut of the token docs, please chime in if there are additional topics you'd like to see.

Fixes: #132

mvines
mvines previously approved these changes Jul 28, 2020

The project comprises:
This program provides an interface and implementation that third parties can use to create and trade their tokens.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This program provides an interface and implementation that third parties can use to create and trade their tokens.
This program provides an interface and implementation that third parties can use to create and use their tokens.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the first use => utilize?


## Interface

The on-chain Token Program is written in Rust and available on crates.io as [spl-token](https://docs.rs/spl-token/1.0.2/spl_token/) documents the program's [instruction interface documentation](https://docs.rs/spl-token/1.0.2/spl_token/instruction/enum.TokenInstruction.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..as [spl-token](https://docs.rs/spl-token/1.0.2/spl_token/) documents.. -- something's wrong with the sentence here

Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap lines to 80 chars?


[Client side bindings](https://github.com/solana-labs/solana-program-library/blob/master/token/js/client/token.js) are available in Javascript to load a Token Program and issue instructions

[Javascript bindings](https://github.com/solana-labs/solana-program-library/blob/master/token/js/client/token.js) are available that support loading the Token Program on to a chain and issuing instructions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant with previous line


The project comprises:
This program provides an interface and implementation that third parties can use to create and trade their tokens.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the first use => utilize?


A new token type can be created by initializing a new Mint with the `InitializeMint` instruction. The Mint is used to create or "Mint" new tokens, and these tokens are stored in Accounts. A Mint is associated with each Account, which means that the total supply of a particular token type is equal to the balances of all the associated Accounts.

A Mint can either be configured with a fixed-supply or not. The total supply of a fixed-supply Mint is determined during initialization and deposited into a provided destination account. A non-fixed-supply Mint also has an owner associated with it who has the authority to create new tokens in the future with the `MintTo` instruction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A Mint can either be configured with a fixed-supply or not. The total supply of a fixed-supply Mint is determined during initialization and deposited into a provided destination account. A non-fixed-supply Mint also has an owner associated with it who has the authority to create new tokens in the future with the `MintTo` instruction.
A Mint can either be configured with a fixed or non-fixed supply. The total supply of a fixed-supply Mint is determined during initialization and deposited into a provided destination account. A non-fixed-supply Mint has an owner associated with it who has the authority to create new tokens in the future with the `MintTo` instruction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth mentioning burn instructions here because AFAICT you can still burn "fixed-supply" mint tokens which would decrease the supply

token/README.md Outdated

The project comprises:
This program provides an interface and implementation that third parties can use to create and trade their own tokens.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit to match whatever you end up with in docs/src/token.md

@mergify mergify bot dismissed mvines’s stale review July 28, 2020 17:19

Pull request has been modified.

@jackcmay jackcmay merged commit 691a213 into solana-labs:master Jul 28, 2020
@jackcmay jackcmay deleted the add-token-docs branch July 28, 2020 18:00
codewithgun pushed a commit to MeteoraAg/solana-program-library that referenced this pull request Feb 20, 2024
* try running CI on big runners (solana-labs#126)

* pack / unpack unit tests (solana-labs#135)

* Isolated Tier Assets (solana-labs#134)

* socialize loss feature (solana-labs#136)

* Liquidation changes (solana-labs#139)

* fully liquidate obligation liquidity if borrow value is < 1 and
correctly handle dust

* cap forgiveness amount wrt ctoken ratio (solana-labs#144)

* On liq, assets must be repaid in order of borrow weight (decending) (solana-labs#141)

* highest borrow weight liquidity must be repaid first

* order borrows by (borrow weight, mint pubkey) and don't convert borrow
weight to decimal

* risk authority (solana-labs#142)

* added risk authority to lending market, setLendingMarketOwnerAndConfig
instruction, and fixed tests

* modified update_reserve_config to use risk authority + tests

* update comment math and handle program upgrade case for risk authority

* add back compute units to tests (solana-labs#150)

* adding compute unit limits

* adding back compute units to test

* Trilinear interest rates (solana-labs#149)

* trilinear interest rates

* edge case handling in Reserve::unpack

* rename unhealthy utilization rate to max utilization rate

* pr comment

* Onchain metadata (solana-labs#151)

* metadata

* metadata

* making LendingMarketMetadata zero copy

* add lookup tables

* review fixes

* verify serialized tx size

---------

Co-authored-by: 0xripleys <0xripleys@solend.fi>

* 0xripleys dynamic liquidation bonus (solana-labs#147)

* dynamic liquidation bonus

* changing the behavior of protocol_liquidation_fee

* comment add

* tests for calculate protocol liquidation fee

* adding more safeguards wrt bonus checking

* add tests that use protocol_liquidation_fee

* fix tests

* PR fixes

* changing protocol liquidation fee to be denominated in deca bps

* support max borrows/withdraws (solana-labs#148)

* support max withdraw and borrow

* changing function signature of a test helper fn

* tests for borrow/withdraw max on rate limiter

* rebase fixes

* PR fixes

* rate limiter test fixes + fmt

* audit fixes (solana-labs#154)

* audit fixes

* add test for refresh obligation filtering

* moar audit fixes

* break borrow weight tiebreaks by reserve pubkey, not mint (solana-labs#158)

* fix version numbers, add name to library (solana-labs#159)

* cli changes (solana-labs#155)

* cli changes

* cli fixes + adding subcommands to view accounts

* clippy fixes

* fix CI error

---------

Co-authored-by: nope <83512286+nope-finance@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Token init instructions don't check if accounts are signers
4 participants