POL Price: $0.704089 (+1.07%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 3 internal transactions

Parent Transaction Hash Block From To
536809352024-02-18 20:52:50292 days ago1708289570
0x91e95f16...Df4ceBDF7
 Contract Creation0 POL
536809352024-02-18 20:52:50292 days ago1708289570
0x91e95f16...Df4ceBDF7
 Contract Creation0 POL
536809352024-02-18 20:52:50292 days ago1708289570
0x91e95f16...Df4ceBDF7
 Contract Creation0 POL
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XYZ Relayer

Compiler Version
vyper:0.3.10

Optimization Enabled:
N/A

Other Settings:
MIT license

Contract Source Code (Vyper language format)

# @version 0.3.10
"""
@title XYZ Relayer
@author CurveFi
"""


event SetMessenger:
    messenger: address


interface IAgent:
    def execute(_messages: DynArray[Message, MAX_MESSAGES]): nonpayable


enum Agent:
    OWNERSHIP
    PARAMETER
    EMERGENCY


struct Message:
    target: address
    data: Bytes[MAX_BYTES]


MAX_BYTES: constant(uint256) = 1024
MAX_MESSAGES: constant(uint256) = 8

CODE_OFFSET: constant(uint256) = 3


OWNERSHIP_AGENT: public(immutable(address))
PARAMETER_AGENT: public(immutable(address))
EMERGENCY_AGENT: public(immutable(address))


agent: HashMap[Agent, address]
messenger: public(address)


@external
def __init__(_agent_blueprint: address, _messenger: address):
    self.messenger = _messenger
    log SetMessenger(_messenger)

    OWNERSHIP_AGENT = create_from_blueprint(_agent_blueprint, code_offset=CODE_OFFSET)
    PARAMETER_AGENT = create_from_blueprint(_agent_blueprint, code_offset=CODE_OFFSET)
    EMERGENCY_AGENT = create_from_blueprint(_agent_blueprint, code_offset=CODE_OFFSET)

    self.agent[Agent.OWNERSHIP] = OWNERSHIP_AGENT
    self.agent[Agent.PARAMETER] = PARAMETER_AGENT
    self.agent[Agent.EMERGENCY] = EMERGENCY_AGENT


@external
def relay(_agent: Agent, _messages: DynArray[Message, MAX_MESSAGES]):
    """
    @notice Receive messages for an agent and relay them.
    @param _agent The agent to relay messages to.
    @param _messages The sequence of messages to relay.
    """
    assert msg.sender == self.messenger

    IAgent(self.agent[_agent]).execute(_messages)


@external
def set_messenger(_messenger: address):
    """
    @notice Set the messenger which verifies messages and is permitted to call `relay`.
    @dev Only callable by the OWNERSHIP_AGENT.
    """
    assert msg.sender == OWNERSHIP_AGENT

    self.messenger = _messenger
    log SetMessenger(_messenger)

Contract Security Audit

Contract ABI

[{"name":"SetMessenger","inputs":[{"name":"messenger","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_agent_blueprint","type":"address"},{"name":"_messenger","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"relay","inputs":[{"name":"_agent","type":"uint256"},{"name":"_messages","type":"tuple[]","components":[{"name":"target","type":"address"},{"name":"data","type":"bytes"}]}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_messenger","inputs":[{"name":"_messenger","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"OWNERSHIP_AGENT","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"PARAMETER_AGENT","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"EMERGENCY_AGENT","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"messenger","inputs":[],"outputs":[{"name":"","type":"address"}]}]

6102f65150346101395760206104096000396000518060a01c6101395760405260206104296000396000518060a01c610139576060526060516001557f1cad8cc1a8d1a401572813203e22d0879c363a2a84037659987e185b0354ba0460605160805260206080a16040516003813b0359600182126101395781600382853c81816000f08015610139579050905090506102b6526040516003813b0359600182126101395781600382853c81816000f08015610139579050905090506102d6526040516003813b0359600182126101395781600382853c81816000f08015610139579050905090506102f6526102b651600060016020526000526040600020556102d651600060026020526000526040600020556102f651600060046020526000526040600020556102b661013e61000039610316610000f35b600080fd60003560e01c60026005820660011b6102ac01601e39600051565b63b8eee20e81186102a157346102a75760206102b660403960206040f36102a1565b633175905b81186102a157346102a75760206102d660403960206040f36102a1565b63c67aac47811861007c57346102a75760206102f660403960206040f35b63f6caf9108118610219576064361034176102a7576004358060031c6102a75760405260243560040160088135116102a7578035600081600881116102a757801561011457905b61044081026080018160051b602086010135602086010180358060a01c6102a7578252602081013581016104008135116102a7576020813501602084018183823750505050506001018181186100c3575b505080606052505060015433186102a757600060405160205260005260406000205463baae8abf612280526020806122a052806122a00160006060518083528060051b600082600881116102a75780156101e057905b828160051b60208801015261044081026080018360208801016040825182528060208301526020830181830160208251018082828560045afa50508051806020830101601f82600003163682375050601f19601f825160200101169050905081019050905090508301925060010181811861016a575b50508201602001915050905081015050803b156102a757600061228061244461229c6000855af1610216573d600060003e3d6000fd5b50005b6368007e1281186102a1576024361034176102a7576004358060a01c6102a75760405260206102b660003960005133186102a7576040516001557f1cad8cc1a8d1a401572813203e22d0879c363a2a84037659987e185b0354ba0460405160605260206060a1006102a1565b633cb747bf81186102a157346102a75760015460405260206040f35b60006000fd5b600080fd0285003c001a005e02a1841902b6810a1860a16576797065728300030a00150000000000000000000000001fe46da288a55aaf32facc6d182fb1933b22c2e900000000000000000000000043dac0b0d040376335f084e058fc6212677a6043

Deployed Bytecode

0x60003560e01c60026005820660011b6102ac01601e39600051565b63b8eee20e81186102a157346102a75760206102b660403960206040f36102a1565b633175905b81186102a157346102a75760206102d660403960206040f36102a1565b63c67aac47811861007c57346102a75760206102f660403960206040f35b63f6caf9108118610219576064361034176102a7576004358060031c6102a75760405260243560040160088135116102a7578035600081600881116102a757801561011457905b61044081026080018160051b602086010135602086010180358060a01c6102a7578252602081013581016104008135116102a7576020813501602084018183823750505050506001018181186100c3575b505080606052505060015433186102a757600060405160205260005260406000205463baae8abf612280526020806122a052806122a00160006060518083528060051b600082600881116102a75780156101e057905b828160051b60208801015261044081026080018360208801016040825182528060208301526020830181830160208251018082828560045afa50508051806020830101601f82600003163682375050601f19601f825160200101169050905081019050905090508301925060010181811861016a575b50508201602001915050905081015050803b156102a757600061228061244461229c6000855af1610216573d600060003e3d6000fd5b50005b6368007e1281186102a1576024361034176102a7576004358060a01c6102a75760405260206102b660003960005133186102a7576040516001557f1cad8cc1a8d1a401572813203e22d0879c363a2a84037659987e185b0354ba0460405160605260206060a1006102a1565b633cb747bf81186102a157346102a75760015460405260206040f35b60006000fd5b600080fd0285003c001a005e02a10000000000000000000000008cb05bfed65b522a7cf98d590f1711a9db43af710000000000000000000000003cf7c393519ea55d1e1f2c55a6395be63b1a9f9c0000000000000000000000009fd6e204e08867170dde54a8374083ff592ebd3e

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000001fe46da288a55aaf32facc6d182fb1933b22c2e900000000000000000000000043dac0b0d040376335f084e058fc6212677a6043

-----Decoded View---------------
Arg [0] : _agent_blueprint (address): 0x1fE46Da288A55aAf32facc6D182fB1933B22c2E9
Arg [1] : _messenger (address): 0x43DaC0b0d040376335f084e058fc6212677A6043

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001fe46da288a55aaf32facc6d182fb1933b22c2e9
Arg [1] : 00000000000000000000000043dac0b0d040376335f084e058fc6212677a6043


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.