Contract 0x5F2f6721Ca0C5AC522BC875fA3F09bF693dcFa1D 1

 
Txn Hash Method
Index
From
To
Value
0x3deec19d1436dd01b8e221f35a05d65bcf159578c6779651caa1922033017ddb0x60806040100787062022-06-01 20:01:53121 days 1 hr agoVelodrome Finance: Deployer IN  Create: VeArtProxy0 Ether0.0052272615590.001
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VeArtProxy

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : VeArtProxy.sol
pragma solidity 0.8.13;

import {Base64} from "contracts/libraries/Base64.sol";
import {IVeArtProxy} from "contracts/interfaces/IVeArtProxy.sol";

contract VeArtProxy is IVeArtProxy {
    function toString(uint value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT license
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint temp = value;
        uint digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    function _tokenURI(uint _tokenId, uint _balanceOf, uint _locked_end, uint _value) external pure returns (string memory output) {
        output = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';
        output = string(abi.encodePacked(output, "token ", toString(_tokenId), '</text><text x="10" y="40" class="base">'));
        output = string(abi.encodePacked(output, "balanceOf ", toString(_balanceOf), '</text><text x="10" y="60" class="base">'));
        output = string(abi.encodePacked(output, "locked_end ", toString(_locked_end), '</text><text x="10" y="80" class="base">'));
        output = string(abi.encodePacked(output, "value ", toString(_value), '</text></svg>'));

        string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "lock #', toString(_tokenId), '", "description": "Velodrome locks, can be used to boost gauge yields, vote on token emission, and receive bribes", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}'))));
        output = string(abi.encodePacked('data:application/json;base64,', json));
    }
}

File 2 of 3 : Base64.sol
pragma solidity 0.8.13;

/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
        uint len = data.length;
        if (len == 0) return "";

        // multiply by 4/3 rounded up
        uint encodedLen = 4 * ((len + 2) / 3);

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

File 3 of 3 : IVeArtProxy.sol
pragma solidity 0.8.13;

interface IVeArtProxy {
    function _tokenURI(uint _tokenId, uint _balanceOf, uint _locked_end, uint _value) external pure returns (string memory output);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_balanceOf","type":"uint256"},{"internalType":"uint256","name":"_locked_end","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"_tokenURI","outputs":[{"internalType":"string","name":"output","type":"string"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50610a2b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063dd9ec14914610030575b600080fd5b61004361003e366004610403565b610059565b6040516100509190610465565b60405180910390f35b606060405180610120016040528060fd81526020016108b960fd913990508061008186610190565b604051602001610092929190610498565b6040516020818303038152906040529050806100ad85610190565b6040516020016100be929190610514565b6040516020818303038152906040529050806100d984610190565b6040516020016100ea929190610594565b60405160208183030381529060405290508061010583610190565b604051602001610116929190610615565b6040516020818303038152906040529050600061016361013587610190565b61013e84610299565b60405160200161014f929190610670565b604051602081830303815290604052610299565b905080604051602001610176919061078c565b604051602081830303815290604052915050949350505050565b6060816000036101b75750506040805180820190915260018152600360fc1b602082015290565b8160005b81156101e157806101cb816107e7565b91506101da9050600a83610816565b91506101bb565b60008167ffffffffffffffff8111156101fc576101fc61082a565b6040519080825280601f01601f191660200182016040528015610226576020820181803683370190505b5090505b84156102915761023b600183610840565b9150610248600a86610857565b61025390603061086b565b60f81b81838151811061026857610268610883565b60200101906001600160f81b031916908160001a90535061028a600a86610816565b945061022a565b949350505050565b805160609060008190036102bd575050604080516020810190915260008152919050565b600060036102cc83600261086b565b6102d69190610816565b6102e1906004610899565b905060006102f082602061086b565b67ffffffffffffffff8111156103085761030861082a565b6040519080825280601f01601f191660200182016040528015610332576020820181803683370190505b50905060006040518060600160405280604081526020016109b6604091399050600181016020830160005b868110156103be576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b83526004909201910161035d565b5060038606600181146103d857600281146103e9576103f5565b613d3d60f01b6001198301526103f5565b603d60f81b6000198301525b505050918152949350505050565b6000806000806080858703121561041957600080fd5b5050823594602084013594506040840135936060013592509050565b60005b83811015610450578181015183820152602001610438565b8381111561045f576000848401525b50505050565b6020815260008251806020840152610484816040850160208701610435565b601f01601f19169190910160400192915050565b600083516104aa818460208801610435565b6503a37b5b2b7160d51b90830190815283516104cd816006840160208801610435565b7f3c2f746578743e3c7465787420783d2231302220793d2234302220636c61737360069290910191820152671e913130b9b2911f60c11b6026820152602e01949350505050565b60008351610526818460208801610435565b6903130b630b731b2a7b3160b51b908301908152835161054d81600a840160208801610435565b7f3c2f746578743e3c7465787420783d2231302220793d2236302220636c617373600a9290910191820152671e913130b9b2911f60c11b602a820152603201949350505050565b600083516105a6818460208801610435565b6a03637b1b5b2b22fb2b732160ad1b90830190815283516105ce81600b840160208801610435565b7f3c2f746578743e3c7465787420783d2231302220793d2238302220636c617373600b9290910191820152671e913130b9b2911f60c11b602b820152603301949350505050565b60008351610627818460208801610435565b6503b30b63ab2960d51b908301908152835161064a816006840160208801610435565b6c1e17ba32bc3a1f1e17b9bb339f60991b60069290910191820152601301949350505050565b6f7b226e616d65223a20226c6f636b202360801b8152825160009061069c816010850160208801610435565b7f222c20226465736372697074696f6e223a202256656c6f64726f6d65206c6f636010918401918201527f6b732c2063616e206265207573656420746f20626f6f7374206761756765207960308201527f69656c64732c20766f7465206f6e20746f6b656e20656d697373696f6e2c206160508201527f6e64207265636569766520627269626573222c2022696d616765223a2022646160708201527f74613a696d6167652f7376672b786d6c3b6261736536342c0000000000000000609082015283516107718160a8840160208801610435565b61227d60f01b60a8929091019182015260aa01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516107c481601d850160208701610435565b91909101601d0192915050565b634e487b7160e01b600052601160045260246000fd5b6000600182016107f9576107f96107d1565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261082557610825610800565b500490565b634e487b7160e01b600052604160045260246000fd5b600082821015610852576108526107d1565b500390565b60008261086657610866610800565b500690565b6000821982111561087e5761087e6107d1565b500190565b634e487b7160e01b600052603260045260246000fd5b60008160001904831182151516156108b3576108b36107d1565b50029056fe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122038fabbc0c17951549c89071ffbb4e073b9b9bd56645eb5235e587839190cc73a64736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.