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