Comments (14)
We should try to avoid changing the layout from token 1's account as this will impact the ability of existing users to easily migrate.
Changing
from a bool and enum where "2" == "frozen" would meet this requirement
from solana-program-library.
Should be settable only once during token initialization, so itโs possible to guarantee that this token instance cannot freeze accounts.
from solana-program-library.
1. We're like to use the existing mint owner as the freeze authority to avoid changing the mint
This means that freeze-able tokens will by definition have non-fixed supplies, since a mint owner can mint new tokens. Is this an issue?
from solana-program-library.
I think we want the option of a separate freeze authority with a freeze_authority: COption<Pubkey>
to the end of Mint
.
While we pass the optional owner in as an account, process_initialize_mint()
doesn't really care that it's an account. It just does a:
and we could rework InitializeMint
to:
InitializeMint {
amount: u64,
decimals: u8,
mint_authority: Option<Pubkey>,
freeze_authority: Option<Pubkey>,
},
from solana-program-library.
Yeah, I wasn't trying to avoid adding the freeze authority to the mint structure because I think that's necessary. I was addressing @CriesofCarrots 's concern about the complicated InitiaizeMint
instruction.
from solana-program-library.
The freeze authority needs to optionally be a multisig account
from solana-program-library.
Updates:
- We're like to use the existing mint owner as the freeze authority to avoid changing the mint
- There's a strong desire that the bit which indicates that an account is frozen ideally sneaks into the account data without any layout changes, to avoid affecting downstream users
from solana-program-library.
This means that freeze-able tokens will by definition have non-fixed supplies, since a mint owner can mint new tokens. Is this an issue?
Thanks, great point. Yeah lets add that separate freeze authority to the mint then after all
from solana-program-library.
@mvines Is it still okay to expect that the freeze authority will always be the same as the mint owner/multisig, as in Update 1. above? I'm trying to figure out how to handle the accounts passed in with TokenInstruction::InitializeMint
, and the options are a bit complicated if we need to support separate owner and freezer.
If it's all good to expect them to be the same, and we need to change the Mint structure anyway, how about bytes for "supply is fixed" and "token is freezable", and stick with a single owner: COption<Pubkey>
field? It'll save ~30 bytes.
from solana-program-library.
We could have the owner and freeze authority be the same during mint init and then allow folks to change either in a seperate instruction. We already have a SetOwner
instruction and we probably want a SetFreezer
instruction anyway.
from solana-program-library.
We could have the owner and freeze authority be the same during mint init and then allow folks to change either in a seperate instruction
I did consider that but then we do still need a way to toggle freezing in InitializeMint, so we'd still end up adding new fields to InitializeMint
we probably want a SetFreezer instruction anyway.
Yep! Or maybe just replace SetOwner
with SetAuthority
with an enum input
from solana-program-library.
Should be settable only once during token initialization, so itโs possible to guarantee that this token instance cannot freeze accounts.
@aeyakovenko said this above. I'd say that precludes any kind of SetFreezer
or SetAuthority
instruction.
from solana-program-library.
If freezing is disabled on a mint, I agree that it probably shouldn't be possible to enable it later. Like fixed supply. But if freezing is enabled, we do need a Set*
to support key rotation of the freezer key
from solana-program-library.
Okay, makes sense.
Although I generally prefer the pattern of passing in the authority keys as instruction parameters, in the interest of minimizing the changes between token 1 and 2 and consistency across instructions, I will code out Jack's suggestion for you two to ๐
from solana-program-library.
Related Issues (20)
- addExtraAccountMetasForExecute Error: Missing required account in instruction HOT 2
- single-pool: Remove usage of stake::config
- Update to ESLint 9.0 HOT 13
- token-cli: Priority fee support doesn't work
- Optimize Initialization Process in Concurrent Merkle Tree
- CLI spl-token update-metadata doesn't follow expected JSON format HOT 3
- `getOrCreateAssociatedTokenAccount` function returning error `TokenAccountNotFoundError` HOT 1
- spl-transfer-hook create-extra-metas : Result::unwrap()` on an `Err` value: Downcast HOT 10
- @solana/[email protected] causing ESM import errors HOT 8
- Transaction Simulation Fails Due to Invalid Account Data in spl-transfer-hook HOT 1
- Please support Wrapped SOL on Mantle network HOT 1
- @steveluscher, I mentioned package @solana/[email protected] not @solana/spl-token.
- token-2022: Token Metadata instructions do not automatically transfer SOL for rent HOT 1
- Feature: Add `createMemoInstruction` helper function to help with the required memo extension HOT 4
- spl-token initialize-metadata fails with Invalid instruction HOT 1
- Inconsistency between spl_associated_token_account::get_associated_token_address and @solana/spl-token getAssociatedTokenAddressSync HOT 2
- stake-pool-js: Fails to deserialize stake pool due to all the next fees
- SolAna-1
- Token Swap Error - The provided token program does not match the token program expected by the swap HOT 2
- Upgrade compression program so that merkle trees with depths 6-13 can be used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solana-program-library.