CryptoKeySafe CK bracket markCRYPTOKEYSAFE
返回博客
DeFi 安全阅读约需 2 分钟

代币授权允许哪些操作

查看或撤销权限前,先了解 ERC-20 授权额度、签名许可与 ERC-721 操作员权限。

全文以英语提供。

ERC-20 allowance

An ERC-20 approval specifies a spender and an amount for one token contract. A spender can call transferFrom within the current allowance, subject to the contract's rules. An unlimited allowance for that token contract can persist across visits until it changes.

ERC-2612 and ERC-721 permissions

Under ERC-2612, a compatible token can accept a signed permit to set an allowance. Under ERC-721, setApprovalForAll can authorize one operator to manage the owner's NFTs within that token contract. The scope depends on the standard and permission requested.

Find and remove unused permissions

Review approvals on the networks and accounts you actually use. An approval manager can display the spender and allowance and help you submit a revocation where supported. Check that the network confirms the change.

Limit the scope before you sign

When the application and token support it, choose an amount appropriate to the intended operation and review the spender address. A recorded allowance persists after you disconnect your wallet. Read the transaction or message request and check which address it authorizes.