Alfajores Testnet

Contract

0x938335006ea6F9Eb0e8020969cFF94404425e298

Overview

CELO Balance

Celo Alfajores LogoCelo Alfajores LogoCelo Alfajores Logo0 CELO

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
KVStore

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : KVStore.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

contract KVStore {
    uint private constant MAX_STRING_LENGTH = 1000;
    uint private constant BULK_MAX_COUNT = 20;
    mapping(address => mapping(string => string)) private store;

    event DataSaved(address indexed sender, string key, string value);

    function get(
        address _account,
        string memory _key
    ) public view returns (string memory) {
        return store[_account][_key];
    }

    function set(string memory _key, string memory _value) public {
        require(
            bytes(_key).length <= MAX_STRING_LENGTH &&
                bytes(_value).length <= MAX_STRING_LENGTH,
            'Maximum string length'
        );
        store[msg.sender][_key] = _value;
        emit DataSaved(msg.sender, _key, _value);
    }

    function setBulk(string[] memory _keys, string[] memory _values) public {
        require(
            _keys.length == _values.length,
            'Keys and values must have the same length'
        );
        require(_keys.length < BULK_MAX_COUNT, 'Too many entries');

        for (uint i = 0; i < _keys.length; i++) {
            set(_keys[i], _values[i]);
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"string","name":"key","type":"string"},{"indexed":false,"internalType":"string","name":"value","type":"string"}],"name":"DataSaved","type":"event"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"string","name":"_key","type":"string"}],"name":"get","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_key","type":"string"},{"internalType":"string","name":"_value","type":"string"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"_keys","type":"string[]"},{"internalType":"string[]","name":"_values","type":"string[]"}],"name":"setBulk","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Contract Creation Code

608060405234801561001057600080fd5b5061094f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630328829c14610046578063e942b5161461005b578063fc2525ab1461006e575b600080fd5b61005961005436600461063b565b610097565b005b61005961006936600461069f565b6101f7565b61008161007c3660046106f9565b61030a565b60405161008e91906107d2565b60405180910390f35b805182511461012d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4b65797320616e642076616c756573206d75737420686176652074686520736160448201527f6d65206c656e677468000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6014825110610198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f546f6f206d616e7920656e7472696573000000000000000000000000000000006044820152606401610124565b60005b82518110156101f2576101e08382815181106101b9576101b96107ec565b60200260200101518383815181106101d3576101d36107ec565b60200260200101516101f7565b806101ea8161081b565b91505061019b565b505050565b6103e882511115801561020d57506103e8815111155b610273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6178696d756d20737472696e67206c656e67746800000000000000000000006044820152606401610124565b3360009081526020819052604090819020905182919061029490859061087b565b908152602001604051809103902090805190602001906102b59291906103f7565b503373ffffffffffffffffffffffffffffffffffffffff167f111b8e1131df198b5697ae35ffda8583f6aaa59f09dcc58a8461f8cc12bf883b83836040516102fe929190610897565b60405180910390a25050565b60606000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051610358919061087b565b90815260200160405180910390208054610371906108c5565b80601f016020809104026020016040519081016040528092919081815260200182805461039d906108c5565b80156103ea5780601f106103bf576101008083540402835291602001916103ea565b820191906000526020600020905b8154815290600101906020018083116103cd57829003601f168201915b5050505050905092915050565b828054610403906108c5565b90600052602060002090601f016020900481019282610425576000855561046b565b82601f1061043e57805160ff191683800117855561046b565b8280016001018555821561046b579182015b8281111561046b578251825591602001919060010190610450565b5061047792915061047b565b5090565b5b80821115610477576000815560010161047c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561050657610506610490565b604052919050565b600082601f83011261051f57600080fd5b813567ffffffffffffffff81111561053957610539610490565b61056a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016104bf565b81815284602083860101111561057f57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f8301126105ad57600080fd5b8135602067ffffffffffffffff808311156105ca576105ca610490565b8260051b6105d98382016104bf565b93845285810183019383810190888611156105f357600080fd5b84880192505b8583101561062f578235848111156106115760008081fd5b61061f8a87838c010161050e565b83525091840191908401906105f9565b98975050505050505050565b6000806040838503121561064e57600080fd5b823567ffffffffffffffff8082111561066657600080fd5b6106728683870161059c565b9350602085013591508082111561068857600080fd5b506106958582860161059c565b9150509250929050565b600080604083850312156106b257600080fd5b823567ffffffffffffffff808211156106ca57600080fd5b6106d68683870161050e565b935060208501359150808211156106ec57600080fd5b506106958582860161050e565b6000806040838503121561070c57600080fd5b823573ffffffffffffffffffffffffffffffffffffffff8116811461073057600080fd5b9150602083013567ffffffffffffffff81111561074c57600080fd5b6106958582860161050e565b60005b8381101561077357818101518382015260200161075b565b83811115610782576000848401525b50505050565b600081518084526107a0816020860160208601610758565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006107e56020830184610788565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610874577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6000825161088d818460208701610758565b9190910192915050565b6040815260006108aa6040830185610788565b82810360208401526108bc8185610788565b95945050505050565b600181811c908216806108d957607f821691505b60208210811415610913577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea26469706673582212208c72a9dae599ae3df443e0f9ba167cd169104ba05dda1ef4ffc41dc6dff23ac564736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c80630328829c14610046578063e942b5161461005b578063fc2525ab1461006e575b600080fd5b61005961005436600461063b565b610097565b005b61005961006936600461069f565b6101f7565b61008161007c3660046106f9565b61030a565b60405161008e91906107d2565b60405180910390f35b805182511461012d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4b65797320616e642076616c756573206d75737420686176652074686520736160448201527f6d65206c656e677468000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6014825110610198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f546f6f206d616e7920656e7472696573000000000000000000000000000000006044820152606401610124565b60005b82518110156101f2576101e08382815181106101b9576101b96107ec565b60200260200101518383815181106101d3576101d36107ec565b60200260200101516101f7565b806101ea8161081b565b91505061019b565b505050565b6103e882511115801561020d57506103e8815111155b610273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6178696d756d20737472696e67206c656e67746800000000000000000000006044820152606401610124565b3360009081526020819052604090819020905182919061029490859061087b565b908152602001604051809103902090805190602001906102b59291906103f7565b503373ffffffffffffffffffffffffffffffffffffffff167f111b8e1131df198b5697ae35ffda8583f6aaa59f09dcc58a8461f8cc12bf883b83836040516102fe929190610897565b60405180910390a25050565b60606000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051610358919061087b565b90815260200160405180910390208054610371906108c5565b80601f016020809104026020016040519081016040528092919081815260200182805461039d906108c5565b80156103ea5780601f106103bf576101008083540402835291602001916103ea565b820191906000526020600020905b8154815290600101906020018083116103cd57829003601f168201915b5050505050905092915050565b828054610403906108c5565b90600052602060002090601f016020900481019282610425576000855561046b565b82601f1061043e57805160ff191683800117855561046b565b8280016001018555821561046b579182015b8281111561046b578251825591602001919060010190610450565b5061047792915061047b565b5090565b5b80821115610477576000815560010161047c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561050657610506610490565b604052919050565b600082601f83011261051f57600080fd5b813567ffffffffffffffff81111561053957610539610490565b61056a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016104bf565b81815284602083860101111561057f57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f8301126105ad57600080fd5b8135602067ffffffffffffffff808311156105ca576105ca610490565b8260051b6105d98382016104bf565b93845285810183019383810190888611156105f357600080fd5b84880192505b8583101561062f578235848111156106115760008081fd5b61061f8a87838c010161050e565b83525091840191908401906105f9565b98975050505050505050565b6000806040838503121561064e57600080fd5b823567ffffffffffffffff8082111561066657600080fd5b6106728683870161059c565b9350602085013591508082111561068857600080fd5b506106958582860161059c565b9150509250929050565b600080604083850312156106b257600080fd5b823567ffffffffffffffff808211156106ca57600080fd5b6106d68683870161050e565b935060208501359150808211156106ec57600080fd5b506106958582860161050e565b6000806040838503121561070c57600080fd5b823573ffffffffffffffffffffffffffffffffffffffff8116811461073057600080fd5b9150602083013567ffffffffffffffff81111561074c57600080fd5b6106958582860161050e565b60005b8381101561077357818101518382015260200161075b565b83811115610782576000848401525b50505050565b600081518084526107a0816020860160208601610758565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006107e56020830184610788565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610874577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6000825161088d818460208701610758565b9190910192915050565b6040815260006108aa6040830185610788565b82810360208401526108bc8185610788565b95945050505050565b600181811c908216806108d957607f821691505b60208210811415610913577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea26469706673582212208c72a9dae599ae3df443e0f9ba167cd169104ba05dda1ef4ffc41dc6dff23ac564736f6c63430008090033

Block Transaction Gas Used Reward
view all blocks validated

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

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.