Accounts
0x88...9f2c
0x88...9f2c

0x88...9f2c

$500
This contract's source code is verified!
Contract Metadata
Compiler
0.8.25+commit.b61c2a91
Language
Solidity
Contract Source Code
File 1 of 1: LastSeen.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**
 * @title LastSeen
 * @dev Allow to track when a wallet was seen for the last time.
 * @custom:security-contact security@unagi.ch
 */
contract LastSeen {
    // (wallet => last seen) mapping of last seen timestamps
    mapping(address => uint256) private _lastSeens;

    constructor() {}

    function visit() external {
        _lastSeens[msg.sender] = block.timestamp;

        emit Seen(msg.sender);
    }

    function getLastSeen(address wallet) external view returns (uint256) {
        return _lastSeens[wallet];
    }

    event Seen(address wallet);
}
Settings
{
  "compilationTarget": {
    "src/LastSeen.sol": "LastSeen"
  },
  "evmVersion": "paris",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [
    ":@/=src/",
    ":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    ":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
    ":ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    ":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    ":forge-std/=lib/forge-std/src/",
    ":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    ":openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    ":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    ":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
  ]
}
ABI
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"Seen","type":"event"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"getLastSeen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"visit","outputs":[],"stateMutability":"nonpayable","type":"function"}]