Permit2

Arc 瀏覽鏈

0x000000000022d473030f116ddee9f6b43ac78ba3

Solidity v0.8.17+commit.8df45f5f

🤖
透過你的 AI 查詢此合約
參考: 0x000000000022d473030f116ddee9f6b43ac78ba3
範例提示詞: "Tell me the current state of arc/0x000000000022d473030f116ddee9f6b43ac78ba3"
還沒有接入 AI?→ mcp.smarts.md · 瀏覽鏈

管理與風險

誰能修改規則?

No admin risk controls detected from the verified ABI.

概覽

讀取函式
3
寫入函式
12
事件
5

讀取函式

Block #25,189,715 · just now
DOMAIN_SEPARATOR() view → 0xa88a1b742ab6890402e6ee74f2359f3723ab547c6dc3b850249bdbffebe2b18f

Returns the domain separator for the current chain.

開發者: Uses cached version if chainid and address are unchanged from construction.

回傳值

名稱 類型 描述
— bytes32
allowance(address, address, address) view

The mapping is indexed in the above order see: allowance[ownerAddress][tokenAddress][spenderAddress]

開發者: The packed slot holds the allowed amount, expiration at which the allowed amount is no longer valid, and current nonce thats updated on any signature based approvals.

參數

名稱 類型 描述
— address
— address
— address

回傳值

名稱 類型 描述
amount uint160
expiration uint48
nonce uint48
nonceBitmap(address, uint256) view

A map from token owner address and a caller specified word index to a bitmap. Used to set bits in the bitmap to prevent against signature replay protection

開發者: The index, or wordPosition is capped at type(uint248).max

參數

名稱 類型 描述
— address
— uint256

回傳值

名稱 類型 描述
— uint256

寫入函式

approve(token: address, spender: address, amount: uint160, expiration: uint48) nonpayable

///////////////////////////////////////////////////////////

參數

名稱 類型 描述
token address
spender address
amount uint160
expiration uint48
invalidateNonces(token: address, spender: address, newNonce: uint48) nonpayable

Invalidate nonces for a given (token, spender) pair

開發者: Can't invalidate more than 2**16 nonces per transaction.

參數

名稱 類型 描述
token address The token to invalidate nonces for
spender address The spender to invalidate nonces for
newNonce uint48 The new nonce to set. Invalidates all nonces less than it.
invalidateUnorderedNonces(wordPos: uint256, mask: uint256) nonpayable

Invalidates the bits specified in mask for the bitmap at the word position

開發者: The wordPos is maxed at type(uint248).max

參數

名稱 類型 描述
wordPos uint256 A number to index the nonceBitmap at
mask uint256 A bitmap masked against msg.sender's current bitmap at the word position
lockdown(approvals: tuple[]) nonpayable

Enables performing a "lockdown" of the sender's Permit2 identity by batch revoking approvals

參數

名稱 類型 描述
approvals tuple[] Array of approvals to revoke.
permit(owner: address, permitBatch: tuple, signature: bytes) nonpayable

///////////////////////////////////////////////////////////

參數

名稱 類型 描述
owner address
permitBatch tuple
signature bytes
permit(owner: address, permitSingle: tuple, signature: bytes) nonpayable

///////////////////////////////////////////////////////////

參數

名稱 類型 描述
owner address
permitSingle tuple
signature bytes
permitTransferFrom(permit: tuple, transferDetails: tuple, owner: address, signature: bytes) nonpayable

Transfers a token using a signed permit message

開發者: Reverts if the requested amount is greater than the permitted signed amount

參數

名稱 類型 描述
permit tuple The permit data signed over by the owner
transferDetails tuple The spender's requested transfer details for the permitted token
owner address The owner of the tokens to transfer
signature bytes The signature to verify
permitTransferFrom(permit: tuple, transferDetails: tuple[], owner: address, signature: bytes) nonpayable

Transfers a token using a signed permit message

開發者: Reverts if the requested amount is greater than the permitted signed amount

參數

名稱 類型 描述
permit tuple The permit data signed over by the owner
transferDetails tuple[] The spender's requested transfer details for the permitted token
owner address The owner of the tokens to transfer
signature bytes The signature to verify
permitWitnessTransferFrom(permit: tuple, transferDetails: tuple, owner: address, witness: bytes32, witnessTypeString: string, signature: bytes) nonpayable

Includes extra data provided by the caller to verify signature over

開發者: Reverts if the requested amount is greater than the permitted signed amount

參數

名稱 類型 描述
permit tuple The permit data signed over by the owner
transferDetails tuple The spender's requested transfer details for the permitted token
owner address The owner of the tokens to transfer
witness bytes32 Extra data to include when checking the user signature
witnessTypeString string The EIP-712 type definition for remaining string stub of the typehash
signature bytes The signature to verify
permitWitnessTransferFrom(permit: tuple, transferDetails: tuple[], owner: address, witness: bytes32, witnessTypeString: string, signature: bytes) nonpayable

Includes extra data provided by the caller to verify signature over

開發者: Reverts if the requested amount is greater than the permitted signed amount

參數

名稱 類型 描述
permit tuple The permit data signed over by the owner
transferDetails tuple[] The spender's requested transfer details for the permitted token
owner address The owner of the tokens to transfer
witness bytes32 Extra data to include when checking the user signature
witnessTypeString string The EIP-712 type definition for remaining string stub of the typehash
signature bytes The signature to verify
transferFrom(transferDetails: tuple[]) nonpayable

Transfer approved tokens from one address to another

開發者: Requires the from address to have approved at least the desired amount of tokens to msg.sender.

參數

名稱 類型 描述
transferDetails tuple[]
transferFrom(from: address, to: address, amount: uint160, token: address) nonpayable

Transfer approved tokens from one address to another

開發者: Requires the from address to have approved at least the desired amount of tokens to msg.sender.

參數

名稱 類型 描述
from address The address to transfer from
to address The address of the recipient
amount uint160 The amount of the token to transfer
token address The token address to transfer

事件

Approval(owner: address, token: address, spender: address, amount: uint160, expiration: uint48)

Emits an event when the owner successfully sets permissions on a token for the spender.

名稱 類型 已索引 描述
owner address ✓
token address ✓
spender address ✓
amount uint160
expiration uint48
Lockdown(owner: address, token: address, spender: address)

Emits an event when the owner sets the allowance back to 0 with the lockdown function.

名稱 類型 已索引 描述
owner address ✓
token address
spender address
NonceInvalidation(owner: address, token: address, spender: address, newNonce: uint48, oldNonce: uint48)

Emits an event when the owner successfully invalidates an ordered nonce.

名稱 類型 已索引 描述
owner address ✓
token address ✓
spender address ✓
newNonce uint48
oldNonce uint48
Permit(owner: address, token: address, spender: address, amount: uint160, expiration: uint48, nonce: uint48)

Emits an event when the owner successfully sets permissions using a permit signature on a token for the spender.

名稱 類型 已索引 描述
owner address ✓
token address ✓
spender address ✓
amount uint160
expiration uint48
nonce uint48
UnorderedNonceInvalidation(owner: address, word: uint256, mask: uint256)

Emits an event when the owner successfully invalidates an unordered nonce.

名稱 類型 已索引 描述
owner address ✓
word uint256
mask uint256