ETH Price: $1,802.67 (+9.68%)

Contract

0x08b7ECFac2c5754ABafb789c84F8fa37c9f088B0

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Etch1348767772025-04-22 20:05:3117 hrs ago1745352331IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000009231170.00037204
Etch1348386272025-04-21 22:53:5138 hrs ago1745276031IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000460330.0017307
Etch1347399172025-04-19 16:03:313 days ago1745078611IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000001158870.00225592
Etch1346411822025-04-17 9:12:216 days ago1744881141IN
0x08b7ECFa...7c9f088B0
0 ETH0.000001864350.00140075
Etch1343930882025-04-11 15:22:3311 days ago1744384953IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000014091090.00234823
Etch1343924512025-04-11 15:01:1911 days ago1744383679IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000018082410.0015321
Etch1343916392025-04-11 14:34:1511 days ago1744382055IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000036486280.00218088
Etch1343146622025-04-09 19:48:2113 days ago1744228101IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000005281580.00207451
Etch1342202552025-04-07 15:21:2715 days ago1744039287IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000049088330.00489701
Etch1342065962025-04-07 7:46:0916 days ago1744011969IN
0x08b7ECFa...7c9f088B0
0 ETH0.000000830180.02027132
Etch1339957242025-04-02 10:37:0521 days ago1743590225IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000108880.00020032
Etch1339447362025-04-01 6:17:2922 days ago1743488249IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000328180.00119507
Etch1337453822025-03-27 15:32:2126 days ago1743089541IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000453330.00120731
Etch1337446322025-03-27 15:07:2126 days ago1743088041IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000279680.00021453
Etch1337005692025-03-26 14:38:3527 days ago1742999915IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000383710.00065024
Etch1336803072025-03-26 3:23:1128 days ago1742959391IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000094180.0002251
Etch1336513232025-03-25 11:17:0329 days ago1742901423IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000143560.0003514
Etch1335915262025-03-24 2:03:4930 days ago1742781829IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000121590.00020536
Etch1335437262025-03-22 23:30:2931 days ago1742686229IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000146690.00042308
Etch1334587792025-03-21 0:18:5533 days ago1742516335IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000336760.00117238
Etch1332709622025-03-16 15:58:2137 days ago1742140701IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000000179280.00029994
Etch1331803992025-03-14 13:39:3540 days ago1741959575IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000004762620.00084044
Etch1330921642025-03-12 12:38:2542 days ago1741783105IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000004978390.0002143
Etch1330109242025-03-10 15:30:2543 days ago1741620625IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000012197440.0000052
Etch1330051292025-03-10 12:17:1544 days ago1741609035IN
0x08b7ECFa...7c9f088B0
0 ETH0.0000011601340.00104685
VIEW ADVANCED FILTER

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
1067334512023-07-11 8:54:39652 days ago1689065679  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Delegator2

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : Delegator2.sol
// SPDX-License-Identifier: AGPL-3.0
 // github.com/attestate/delegator2
 pragma solidity ^0.8.13;

 contract Delegator2 {
/*
Name:         Delegator2
Description:  Key authority event log for Kiwi News Protocol
Requires:     EIP-712, EIP-2098


Instructions
------------

Any caller may call `etch` such that:

  1. `data[0]` and `data[1]` are respectively the first and the second
      part of an EIP-2098 "Compact Signature."
  2. `data[2]` is a `bytes32` segmented into:

    0x4E774b8530d6f3A21C449A6f0D9A1229aB2b8C47000000000000000000000001
      ^                                      ^^                     ^^
      |                                      ||                     ||
      .--------------------------------------..---------------------.|
      (a bytes20-long `address to`)             (empty)              |
                                                                     |
                                                (the `bool authorize`)

    2.1 `address to` is the entity the transaction's sender (`address
        from`) is delegating authority or revoking it.
    2.2 If `bool authorize` is `true` it means `address from` is
        delegating their authority to `address to`.
    2.3 If `bool authorize` is `false` it means `address from` is revoking
        their authority from `address to`.
  3. The signature in `data[0]` and `data[1]` must be signed according to
     EIP-712.
    3.1 The message is conceptually generated using the following struct:

        struct Authorization {
          address from;
          bool authorize;
        }

    3.2 And an EIP-712 domain separator using the following types and
        values:

        struct EIP712Domain {
          string name     = "kiwinews";
          string version  = "1.0.0";
          uint256 chainId = <chainId>;
          address target  = 0x...(this contract's address)
          bytes32 salt    =
           0xfe7a9d68e99b6942bb3a36178b251da8bd061c20ed1e795207ae97183b590e5b;
        }

    3.3 The message is then signed by `address to` and tucked into a
        transaction signed by `address from` and sent to the network.


Interpretation:
---------------

0. We consider a key delegation from `address from` to `address to` valid
   if:
  0.1 we can "ecrecover" `address to` (the first 20 bytes of `data[2]`)
      from `data[0]` and `data[1]` (an EIP-2098 "Compact Signature") using
      the above-mentioned procedure; AND
  0.2 if the last bit (`bool authorize`) of `data[2]` is "1"; AND
  0.3 if the `address from` of the `Authorization` message appears as the
      "from" property on the event log's transaction receipt.
1. We consider a key revocation by `address from` of `address to` valid if:
  1.1 we can "ecrecover" `address to` (the first 20 bytes of `data[2]`)
      from `data[0]` and `data[1]` (also an EIP-2098 "Compact Signature")
      using the above-mentioned procedure; AND
  1.2 if the last bit (`bool authorize`) of `data[2]` is "0"; AND
  1.3 if the `address from` of the `Authorization` message appears as the
      "from" property on the event log's transaction receipt.


Organize
--------

We receive all delegations in an ordered list, validate each according to the
above-outlined rules and then organize the them according to the following
rules:

  - Each `address from` can delegate to multiple `address to`.
  - Each `address to` can only be delegated to by one `address from`.
  - `address to` and `address from` are never the same.
  - An `address to` cannot become an `address from` and vice versa.
  - The first delegation from an `address from` to an `address to` is
    considered the user's true intent.
  - A revocation is only valid if there has been a prior delegation.
  - A delegation after a revocation does not make a key usable again.

This organization produces an object mapping of each `address to` to the
`address from` of the latest valid delegation. If a delegation is invalid, it
is ignored. 

If an `address from` tries to delegate to an `address to` that has already been
delegated to, we ignore the new delegation. 

If an `address from` revokes its delegation to an `address to`, we remove the
existing delegation. 

If an `address from` tries to delegate to an `address to` after revoking its
delegation to that address, the function ignores the new delegation. This
ensures that a delegation after a revocation does not make a key usable again.

If an `address from` tries to delegate to an `address to` that has already been
used as an `address from`, or if an `address to` tries to become an `address
from`, the function ignores the new delegation. This ensures that an `address
to` cannot become an `address from` and vice versa, maintaining the integrity
of the delegation process.


Rationale
---------

- In a prior iteration (Delegator.sol) we allowed anyone to "etch" a delegation
  to `address to` without requiring an ecrecover-able signature that yields
  `to`'s address. We've found, however, that this opens a vector for anyone to
  impersonate or front-run delegations by "stealing" the transaction's data.
  Hence by directing a signed delegation to `address from`, this makes stealing
  the payload useless for front-runners and verifiably authentic.
- In an even earlier version of the Kiwi News Protocol we had considered
  storing delegations on our set reconciliation network. However, it would
  have allowed a malicious node operator to back-date a delegation message
  or its revocation - which could have interfered with the network's
  reconciliation algorithm.
- In a prior interation of the organization procedure we considered always
  using the latest delegations and revocations as the user's intent. However,
  this increased complexity at the Kiwi News Protocol node level, as then e.g.
  an `address to`, priorly assigned to an `address from_1` could suddenly
  switch to `address from_2`. As those addresses may be represented by ENS
  names, it would be confusing to users if a post suddenly changed author.


Considerations
--------------

- Indexers are recommended to ignore valid delegations where the `address
  from`, `address to` and the transaction receipt's "from" property are the
  same address to avoid cycles.
- The transaction running the eth-call and its payload are not replayable on
  other chains as the chain ID is part of the EIP-712 domain separator. They
  are neither replayable on the same chain as both the verifying contract's
  address and its version are part of the separator too.
- Using CREATE2, the system may be run on multiple chains in parallel. However,
  a total ordering of all transactions from those systems must exist. Hence, if
  say one such contract is run on ETH mainnet and another one on an L2, a total
  order may be producable by virtue of the L2 using L1 storage. This seems to
  hold as well for two L2s considering that their state access on L2 is
  happening in atomic transactions over which we can create a total order.
- Other applications that require a similar system may use the delegator2
  contract but with a different EIP-712 domain separator. Kiwi News Protocol
  would simply consider those payloads invalid, which can be OK if it doesn't
  waste too much compute spent on undirected validation.
*/
   event Delegate(bytes32[3] data);
   function etch(bytes32[3] calldata data) external {
     emit Delegate(data);
   }
 }

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32[3]","name":"data","type":"bytes32[3]"}],"name":"Delegate","type":"event"},{"inputs":[{"internalType":"bytes32[3]","name":"data","type":"bytes32[3]"}],"name":"etch","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80630baa83f814602d575b600080fd5b603c60383660046076565b603e565b005b7f9fcbf2ac7d9825115ae81812d10efa7fce04fcc9ca46f1d416aba53cdea8483e81604051606b9190609c565b60405180910390a150565b600060608284031215608757600080fd5b82606083011115609657600080fd5b50919050565b6060818101908383379291505056fea2646970667358221220a023699f314fe81dbaaa4e917b161d13bc252584f8e3602dca37be52f9e8b5a364736f6c63430008110033

Deployed Bytecode

0x6080604052348015600f57600080fd5b506004361060285760003560e01c80630baa83f814602d575b600080fd5b603c60383660046076565b603e565b005b7f9fcbf2ac7d9825115ae81812d10efa7fce04fcc9ca46f1d416aba53cdea8483e81604051606b9190609c565b60405180910390a150565b600060608284031215608757600080fd5b82606083011115609657600080fd5b50919050565b6060818101908383379291505056fea2646970667358221220a023699f314fe81dbaaa4e917b161d13bc252584f8e3602dca37be52f9e8b5a364736f6c63430008110033

Block Transaction Difficulty 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  ]
[ 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.