-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added WithdrawWithheldTokensFromAccounts IX #3128
Added WithdrawWithheldTokensFromAccounts IX #3128
Conversation
@deanmlittle is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, could you note this feature in the CHANGELOG?
Added Changelog entry
Added a Changelog entry. FYI: I forked the v0.30.1 tag instead of master. Not sure if this is a standard way of making a PR, but the new discriminator changes in master were causing backwards compatibility issues with the CLI, so I wanted to isolate for that. |
It would be better to fork the branch you're PRing to (
Could you expand on this? I don't think the new custom discriminator changes should cause any compatibility issues for the CLI — in fact the CLI code hasn't changed at all to support it (14cec14...c5337c5). There was a discriminator-related breakage from v0.29 -> v0.30 because of the new IDL spec (#2824) and required |
If you import the current master into an anchor program using |
Thanks, the reason for this could be that you haven't changed The CLI itself is unaware of the There will be a conflict in the history due to the CHANGELOG override, could you rebase this branch to |
I do not believe that to be the case. I do not have any third-party packages, and am importing both As this branch is currently being used in prod due the ix not being available in anchor yet, if you would like me to submit a version forked from master, I will have to create a new PR from that other branch that I initially forked from master, with the caveat that although the code would be identical, I cannot make the claim that it is tested and working locally with CLI v0.30.1 due to the aforementioned discriminator lifetime backwards-compatibility issue. |
Found the culprit: https://github.com/coral-xyz/anchor/blob/master/spl/src/idl_build.rs#L13 If we replace If you would like me to make a combination of these two fixes with this PR, I can do that. |
Hm, what's your Repro: trait Discriminator {
const DISCRIMINATOR: &'static [u8];
}
struct MyStruct;
impl Discriminator for MyStruct {
const DISCRIMINATOR: &[u8] = &[];
} cargo b fails with rust-lang/rust#115010 (stable), but cargo +nightly b compiles.
It wouldn't hurt to annotate the |
Will try nightly and report back shortly. Your explanation makes sense. Sounds like it is a good idea to make that PR anyway so will do that first then rebase this from updated master. |
Will rebase from here here once merged |
Added Changelog entry
…mlittle/based-anchor into withdraw-fees-from-accounts
I have rebased to current master if you wanted to merge this first. The two shouldn't conflict anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
It seems
WithdrawWithheldTokensFromAccounts
ix was missing from token22 transfer fee extensions, so I implemented it.You can check out the instruction here
It allows the fee withdraw authority to withdraw fees from t22 transfer fee extension accounts directly without having to first harvest to mint, then harvest from mint. Code is tested and working locally.
This unlocks the ability for Anchor programs to delegate a PDA signer as the token withdraw authority, drastically improving security, as any signer can invoke an IX to claim tokens to a treasury without having to first claim to a mint account.