ETH Price: $1,588.91 (+0.56%)
Gas: 8 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Register171470602023-04-28 20:39:59150 days 5 hrs ago1682714399IN
0x5e49Ec...4b42B4AF
0 ETH0.0053425232.49610952
Register156636152022-10-02 23:01:35358 days 3 hrs ago1664751695IN
0x5e49Ec...4b42B4AF
0 ETH0.000948075.77006855
Register156487822022-09-30 21:16:47360 days 5 hrs ago1664572607IN
0x5e49Ec...4b42B4AF
0 ETH0.0035149821.39255494
Register156487742022-09-30 21:15:11360 days 5 hrs ago1664572511IN
0x5e49Ec...4b42B4AF
0 ETH0.0025692215.63653005
Register156487612022-09-30 21:12:35360 days 5 hrs ago1664572355IN
0x5e49Ec...4b42B4AF
0 ETH0.0029001817.67144202
Register156487572022-09-30 21:11:47360 days 5 hrs ago1664572307IN
0x5e49Ec...4b42B4AF
0 ETH0.0030276718.44829797
Register156487302022-09-30 21:06:23360 days 5 hrs ago1664571983IN
0x5e49Ec...4b42B4AF
0 ETH0.0026370116.0491404
Register156487242022-09-30 21:05:11360 days 5 hrs ago1664571911IN
0x5e49Ec...4b42B4AF
0 ETH0.0027650816.8285799
Register156487192022-09-30 21:04:11360 days 5 hrs ago1664571851IN
0x5e49Ec...4b42B4AF
0 ETH0.0029044617.67685594
Register156487012022-09-30 21:00:35360 days 5 hrs ago1664571635IN
0x5e49Ec...4b42B4AF
0 ETH0.0026608816.19438842
Register156281572022-09-28 0:08:11363 days 2 hrs ago1664323691IN
0x5e49Ec...4b42B4AF
0 ETH0.001375858.38156668
Register149665802022-06-15 8:35:15467 days 17 hrs ago1655282115IN
0x5e49Ec...4b42B4AF
0 ETH0.0121617469.29964125
Register148812802022-05-31 22:27:20482 days 3 hrs ago1654036040IN
0x5e49Ec...4b42B4AF
0 ETH0.0137617183.75506161
Register140048372022-01-14 16:58:19619 days 9 hrs ago1642179499IN
0x5e49Ec...4b42B4AF
0 ETH0.05196746140.4526137
Register140047092022-01-14 16:28:51619 days 9 hrs ago1642177731IN
0x5e49Ec...4b42B4AF
0 ETH0.04800204184.62325731
Register138418722021-12-20 12:00:13644 days 14 hrs ago1640001613IN
0x5e49Ec...4b42B4AF
0 ETH0.007049443.02591519
Register135608042021-11-06 4:12:15688 days 22 hrs ago1636171935IN
0x5e49Ec...4b42B4AF
0 ETH0.0151251992.05334369
Register133600582021-10-05 16:14:18720 days 10 hrs ago1633450458IN
0x5e49Ec...4b42B4AF
0 ETH0.01776034108.09111243
Register132028172021-09-11 6:23:56744 days 19 hrs ago1631341436IN
0x5e49Ec...4b42B4AF
0 ETH0.0127068277.55015833
Register131405742021-09-01 15:28:37754 days 10 hrs ago1630510117IN
0x5e49Ec...4b42B4AF
0 ETH0.0305376185.85471579
Register131301622021-08-31 0:39:42756 days 1 hr ago1630370382IN
0x5e49Ec...4b42B4AF
0 ETH0.0209657569.8858637
Register131228492021-08-29 21:38:54757 days 4 hrs ago1630273134IN
0x5e49Ec...4b42B4AF
0 ETH0.00335434115.66710687
Register131228302021-08-29 21:34:45757 days 4 hrs ago1630272885IN
0x5e49Ec...4b42B4AF
0 ETH0.00368609127.10666202
Register130959572021-08-25 17:58:44761 days 8 hrs ago1629914324IN
0x5e49Ec...4b42B4AF
0 ETH0.01950317119.54504301
Register130957982021-08-25 17:23:35761 days 8 hrs ago1629912215IN
0x5e49Ec...4b42B4AF
0 ETH0.01899315116.45314824
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Avatars

Compiler Version
v0.4.9+commit.364da425

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2017-03-15
*/

pragma solidity ^0.4.3;

contract Avatars {
    
    uint avatarsCount = 0;

    struct Avatar {
        uint id;
        
        /**
         * Avatar's owner.
         */ 
        address owner;
        
        /**
         * First byte is gender, 1 / 0 for male / female. 
         * Then every byte describe choosen avatar part. 
         * The order is : backs, clothes, ears, eyebrows, eyesfront, eyesiris, faceshape, glasses, hair, mouth, nose, beard, mustache. 
         */ 
        bytes32 shapes;
        
        /**
         * Each 3 bytes describe color for 5 first shapes.
         */
        bytes32 colorsPrimary;
        
        /**
         * Each 3 bytes describe color for 8 last shapes.
         */
        bytes32 colorsSecondary;
        
        /**
         * Each byte describes up/down position for every shape. 
         * High nibble depicts the sign of number, 1 - up, 0 - down.
         * Low nibble shows number of steps to move the shape in selected direction.
         * 
         */
        bytes32 positions;
    }
    
    mapping(bytes32 => Avatar) avatars;
    
    /**
     * Stores an avatar on the blockchain.
     * Throws if avatar with such shapes combination is already exists.
     * 
     * @param shapes - hex string, depicts gender and combinations of shapes.
     * @param colorsPrimary - hex string, colors of the first 5 shapes.
     * @param colorsSecondary - hex string, colors of the last 8 shapes.
     * @param positions - hex string, up/down positions of all shapes
     * 
     * @return Hash of the avatar.
     */
    function register(string shapes, string colorsPrimary, string colorsSecondary, string positions) returns (bytes32 avatarHash) {
        bytes32 shapesBytes = strToBytes(shapes);
        bytes32 colorsPrimaryBytes = strToBytes(colorsPrimary);
        bytes32 colorsSecondaryBytes = strToBytes(colorsSecondary);
        bytes32 positionsBytes = strToBytes(positions);

        // unique by shapes composition
        bytes32 hash = sha3(shapes);

        Avatar memory existingAvatar = avatars[hash];
        if (existingAvatar.id != 0)
            throw;
        
        Avatar memory avatar = Avatar(++avatarsCount, msg.sender, 
            shapesBytes,
            colorsPrimaryBytes,
            colorsSecondaryBytes,
            positionsBytes);

        avatars[hash] = avatar;
        return hash;
    }
    
    /**
     * Returns an avatar by it's hash.
     * Throws if avatar is not exists.
     */ 
    function get(bytes32 avatarHash) constant returns (bytes32 shapes, bytes32 colorsPrimary, bytes32 colorsSecondary, bytes32 positions) {
        Avatar memory avatar = getAvatar(avatarHash);
        
        shapes = avatar.shapes;
        colorsPrimary = avatar.colorsPrimary;
        colorsSecondary = avatar.colorsSecondary;
        positions = avatar.positions;
    }
    
    /**
     * Returns an avatar owner address by avatar's hash.
     * Throws if avatar is not exists.
     */ 
    function getOwner(bytes32 avatarHash) constant returns (address) {
        Avatar memory avatar = getAvatar(avatarHash);
        return avatar.owner;
    }
    
        
    /**
     * Returns if avatar of the given hash exists.
     */ 
    function isExists(bytes32 avatarHash) constant returns (bool) {
        Avatar memory avatar = avatars[avatarHash];
        if (avatar.id == 0)
            return false;
            
        return true;
    }
    
    /**
     * Returns an avatar by it's hash.
     * Throws if avatar is not exists.
     */ 
    function getAvatar(bytes32 avatarHash) private constant returns (Avatar) {
        Avatar memory avatar = avatars[avatarHash];
        if (avatar.id == 0)
           throw;
           
        return avatar;
    }
    
    /**
     * @dev Low level function.
     * Converts string to bytes32 array.
     * Throws if string length is more than 32 bytes
     * 
     * @param str string
     * @return bytes32 representation of str
     */
    function strToBytes(string str) constant private returns (bytes32 ret) {
        // var g = bytes(str).length;
        // if (bytes(str).length > 32) throw;
        
        assembly {
            ret := mload(add(str, 32))
        }
    } 
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"shapes","type":"string"},{"name":"colorsPrimary","type":"string"},{"name":"colorsSecondary","type":"string"},{"name":"positions","type":"string"}],"name":"register","outputs":[{"name":"avatarHash","type":"bytes32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"avatarHash","type":"bytes32"}],"name":"isExists","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"avatarHash","type":"bytes32"}],"name":"get","outputs":[{"name":"shapes","type":"bytes32"},{"name":"colorsPrimary","type":"bytes32"},{"name":"colorsSecondary","type":"bytes32"},{"name":"positions","type":"bytes32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"avatarHash","type":"bytes32"}],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}]

60606040526000600055341561001157fe5b5b610584806100216000396000f300606060405263ffffffff60e060020a6000350416630e24c52c81146100425780638a881e0e146101615780638eaa6ac014610188578063deb931a2146101c1575bfe5b341561004a57fe5b61014f600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979998810197919650918201945092508291508401838280828437509496506101f095505050505050565b60408051918252519081900360200190f35b341561016957fe5b6101746004356103ae565b604080519115158252519081900360200190f35b341561019057fe5b61019b600435610431565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34156101c957fe5b6101d4600435610471565b60408051600160a060020a039092168252519081900360200190f35b600060006000600060006000610204610523565b61020c610523565b6102158c610494565b96506102208b610494565b955061022b8a610494565b945061023689610494565b93508b6040518082805190602001908083835b602083106102685780518252601f199092019160209182019101610249565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600081815260018084529086902060c085018752805480865291810154600160a060020a031693850193909352600283015495840195909552600382015460608401526004820154608084015260059091015460a083015297509550501591506102fa905057610000565b506040805160c081018252600080546001908101808355835233600160a060020a0390811660208086019182528587018d8152606087018d8152608088018d815260a089018d81528c89529387905298909620875181559251948301805473ffffffffffffffffffffffffffffffffffffffff191695909416949094179092559151600283015591516003820155925160048401555160059092019190915591965086915b50505050505050949350505050565b60006103b8610523565b50600082815260016020818152604092839020835160c081018552815480825293820154600160a060020a031692810192909252600281015493820193909352600383015460608201526004830154608082015260059092015460a08301521515610426576000915061042b565b600191505b50919050565b6000600060006000610441610523565b61044a8661049f565b90508060400151945080606001519350806080015192508060a0015191505b509193509193565b600061047b610523565b6104848361049f565b9050806020015191505b50919050565b60208101515b919050565b6104a7610523565b6104af610523565b50600082815260016020818152604092839020835160c081018552815480825293820154600160a060020a031692810192909252600281015493820193909352600383015460608201526004830154608082015260059092015460a0830152151561051957610000565b8091505b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152905600a165627a7a7230582031a5d757f81f0bf1c0dda3691a8f2d1bc7b86cf2fecc9b9a418e31f6aed61f150029

Deployed Bytecode

0x606060405263ffffffff60e060020a6000350416630e24c52c81146100425780638a881e0e146101615780638eaa6ac014610188578063deb931a2146101c1575bfe5b341561004a57fe5b61014f600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979998810197919650918201945092508291508401838280828437509496506101f095505050505050565b60408051918252519081900360200190f35b341561016957fe5b6101746004356103ae565b604080519115158252519081900360200190f35b341561019057fe5b61019b600435610431565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34156101c957fe5b6101d4600435610471565b60408051600160a060020a039092168252519081900360200190f35b600060006000600060006000610204610523565b61020c610523565b6102158c610494565b96506102208b610494565b955061022b8a610494565b945061023689610494565b93508b6040518082805190602001908083835b602083106102685780518252601f199092019160209182019101610249565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600081815260018084529086902060c085018752805480865291810154600160a060020a031693850193909352600283015495840195909552600382015460608401526004820154608084015260059091015460a083015297509550501591506102fa905057610000565b506040805160c081018252600080546001908101808355835233600160a060020a0390811660208086019182528587018d8152606087018d8152608088018d815260a089018d81528c89529387905298909620875181559251948301805473ffffffffffffffffffffffffffffffffffffffff191695909416949094179092559151600283015591516003820155925160048401555160059092019190915591965086915b50505050505050949350505050565b60006103b8610523565b50600082815260016020818152604092839020835160c081018552815480825293820154600160a060020a031692810192909252600281015493820193909352600383015460608201526004830154608082015260059092015460a08301521515610426576000915061042b565b600191505b50919050565b6000600060006000610441610523565b61044a8661049f565b90508060400151945080606001519350806080015192508060a0015191505b509193509193565b600061047b610523565b6104848361049f565b9050806020015191505b50919050565b60208101515b919050565b6104a7610523565b6104af610523565b50600082815260016020818152604092839020835160c081018552815480825293820154600160a060020a031692810192909252600281015493820193909352600383015460608201526004830154608082015260059092015460a0830152151561051957610000565b8091505b50919050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152905600a165627a7a7230582031a5d757f81f0bf1c0dda3691a8f2d1bc7b86cf2fecc9b9a418e31f6aed61f150029

Swarm Source

bzzr://31a5d757f81f0bf1c0dda3691a8f2d1bc7b86cf2fecc9b9a418e31f6aed61f15

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn 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.