fix: reject off-curve owners during ATA creation
This commit is contained in:
parent
975b524487
commit
7320cf404b
|
@ -2239,6 +2239,9 @@ export class Token {
|
|||
mint: PublicKey,
|
||||
owner: PublicKey,
|
||||
): Promise<PublicKey> {
|
||||
if (!PublicKey.isOnCurve(owner.toBuffer())) {
|
||||
throw new Error(`Owner cannot sign: ${owner.toString()}`);
|
||||
}
|
||||
return (
|
||||
await PublicKey.findProgramAddress(
|
||||
[owner.toBuffer(), programId.toBuffer(), mint.toBuffer()],
|
||||
|
|
Loading…
Reference in New Issue