Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MediaRegistry
- Optimization enabled
- true
- Compiler version
- v0.4.21+commit.dfe3193c
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-10-04T04:17:30.937960Z
Contract source code
pragma solidity ^0.4.11; contract MediaRegistry { event Registered(string _name); event Removed(string _name); address public owner; mapping (address => bool) moderator; mapping (bytes32 => entry) entries; mapping (string => bool) official_links; function MediaRegistry() { owner = 0x94bFC161f889224b00A49C94812d456Ca54A7415; } struct entry { string name; string link; string metadata; } function add_entry(string _name, string _link, string _metadata) access_restriction { entries[bytes32( sha3( _name ) )].name = _name; entries[bytes32( sha3( _name ) )].link = _link; entries[bytes32( sha3( _name ) )].metadata = _metadata; official_links[_link] = true; Registered(_name); } function remove_entry(string _name) access_restriction { official_links[entries[bytes32(sha3(_name))].link] = false; delete(entries[bytes32( sha3( _name ) )].name); delete(entries[bytes32( sha3( _name ) )].link); delete(entries[bytes32( sha3( _name ) )].metadata); Removed(_name); } function get_entry(string _name) constant returns (string, string, string) { return ( entries[bytes32( sha3( _name ) )].name, entries[bytes32( sha3( _name ) )].link, entries[bytes32( sha3( _name ) )].metadata ); } function is_official(string _link) constant returns (bool) { return official_links[_link]; } function hire(address _who) only_owner { moderator[_who] = true; } function fire(address _who) only_owner { moderator[_who] = false; } function transfer_ownership(address _who) only_owner { owner = _who; } modifier only_owner { require(msg.sender == owner); _; } modifier access_restriction { require(msg.sender == owner || moderator[msg.sender]); _; } }
Contract ABI
[{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"remove_entry","inputs":[{"type":"string","name":"_name"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"fire","inputs":[{"type":"address","name":"_who"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"add_entry","inputs":[{"type":"string","name":"_name"},{"type":"string","name":"_link"},{"type":"string","name":"_metadata"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"hire","inputs":[{"type":"address","name":"_who"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"string","name":""},{"type":"string","name":""},{"type":"string","name":""}],"name":"get_entry","inputs":[{"type":"string","name":"_name"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"is_official","inputs":[{"type":"string","name":"_link"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"transfer_ownership","inputs":[{"type":"address","name":"_who"}],"constant":false},{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[]},{"type":"event","name":"Registered","inputs":[{"type":"string","name":"_name","indexed":false}],"anonymous":false},{"type":"event","name":"Removed","inputs":[{"type":"string","name":"_name","indexed":false}],"anonymous":false}]
Contract Creation Code
0x6060604052341561000f57600080fd5b60008054600160a060020a0319167394bfc161f889224b00a49c94812d456ca54a7415179055611050806100446000396000f30060606040526004361061008d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166376385db681146100925780637885c960146100e55780638da5cb5b14610104578063c8156f1e14610133578063d9d6bd8614610208578063dc10d70614610227578063e6b0c046146103c2578063f0350c0414610427575b600080fd5b341561009d57600080fd5b6100e360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061044695505050505050565b005b34156100f057600080fd5b6100e3600160a060020a036004351661079d565b341561010f57600080fd5b6101176107d9565b604051600160a060020a03909116815260200160405180910390f35b341561013e57600080fd5b6100e360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506107e895505050505050565b341561021357600080fd5b6100e3600160a060020a0360043516610ace565b341561023257600080fd5b61027860046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b1095505050505050565b60405180806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156102bd5780820151838201526020016102a5565b50505050905090810190601f1680156102ea5780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b83811015610320578082015183820152602001610308565b50505050905090810190601f16801561034d5780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b8381101561038357808201518382015260200161036b565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34156103cd57600080fd5b61041360046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e7495505050505050565b604051901515815260200160405180910390f35b341561043257600080fd5b6100e3600160a060020a0360043516610ee6565b60005433600160a060020a039081169116148061047b5750600160a060020a03331660009081526001602052604090205460ff165b151561048657600080fd5b6000600360026000846040518082805190602001908083835b602083106104be5780518252601f19909201916020918201910161049f565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390208152602081019190915260409081016000206001019051808280546001816001161561010002031660029004801561055a5780601f1061053857610100808354040283529182019161055a565b820191906000526020600020905b815481529060010190602001808311610546575b50509283525050602001604051908190039020805460ff191691151591909117905560026000826040518082805190602001908083835b602083106105b05780518252601f199092019160209182019101610591565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390208152602081019190915260400160009081206105f891610f30565b60026000826040518082805190602001908083835b6020831061062c5780518252601f19909201916020918201910161060d565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060001916600019168152602001908152602001600020600101600061067d9190610f30565b60026000826040518082805190602001908083835b602083106106b15780518252601f199092019160209182019101610692565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060020160006107029190610f30565b7f7b6d36b11079da6c6a954e6a0790a233fb12d452c49b8ba023ac3a19829793618160405160208082528190810183818151815260200191508051906020019080838360005b83811015610760578082015183820152602001610748565b50505050905090810190601f16801561078d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b60005433600160a060020a039081169116146107b857600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b600054600160a060020a031681565b60005433600160a060020a039081169116148061081d5750600160a060020a03331660009081526001602052604090205460ff165b151561082857600080fd5b8260026000856040518082805190602001908083835b6020831061085d5780518252601f19909201916020918201910161083e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020815260208101919091526040016000209080516108ab929160200190610f77565b508160026000856040518082805190602001908083835b602083106108e15780518252601f1990920191602091820191016108c2565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902081526020810191909152604001600020600101908051610932929160200190610f77565b508060026000856040518082805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020815260208101919091526040016000206002019080516109b9929160200190610f77565b5060016003836040518082805190602001908083835b602083106109ee5780518252601f1990920191602091820191016109cf565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020805460ff19169115159190911790557f8b5990d705f635a0482a4e48116f8fb0b728d90317aa3db1ec664a951f432ece8360405160208082528190810183818151815260200191508051906020019080838360005b83811015610a8f578082015183820152602001610a77565b50505050905090810190601f168015610abc5780820380516001836020036101000a031916815260200191505b509250505060405180910390a1505050565b60005433600160a060020a03908116911614610ae957600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b610b18610ff5565b610b20610ff5565b610b28610ff5565b60026000856040518082805190602001908083835b60208310610b5c5780518252601f199092019160209182019101610b3d565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060000160026000866040518082805190602001908083835b60208310610bd55780518252601f199092019160209182019101610bb6565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060010160026000876040518082805190602001908083835b60208310610c4e5780518252601f199092019160209182019101610c2f565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060001916600019168152602001908152602001600020600201828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d285780601f10610cfd57610100808354040283529160200191610d28565b820191906000526020600020905b815481529060010190602001808311610d0b57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b50505050509150808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e605780601f10610e3557610100808354040283529160200191610e60565b820191906000526020600020905b815481529060010190602001808311610e4357829003601f168201915b505050505090509250925092509193909250565b60006003826040518082805190602001908083835b60208310610ea85780518252601f199092019160209182019101610e89565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040519081900390205460ff1692915050565b60005433600160a060020a03908116911614610f0157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b50805460018160011615610100020316600290046000825580601f10610f565750610f74565b601f016020900490600052602060002090810190610f749190611007565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610fb857805160ff1916838001178555610fe5565b82800160010185558215610fe5579182015b82811115610fe5578251825591602001919060010190610fca565b50610ff1929150611007565b5090565b60206040519081016040526000815290565b61102191905b80821115610ff1576000815560010161100d565b905600a165627a7a723058204d7be79e6022fe316e6c1132408f31a878059144b0e1b07806932dc2ae4007c30029
Deployed ByteCode
0x60606040526004361061008d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166376385db681146100925780637885c960146100e55780638da5cb5b14610104578063c8156f1e14610133578063d9d6bd8614610208578063dc10d70614610227578063e6b0c046146103c2578063f0350c0414610427575b600080fd5b341561009d57600080fd5b6100e360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061044695505050505050565b005b34156100f057600080fd5b6100e3600160a060020a036004351661079d565b341561010f57600080fd5b6101176107d9565b604051600160a060020a03909116815260200160405180910390f35b341561013e57600080fd5b6100e360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506107e895505050505050565b341561021357600080fd5b6100e3600160a060020a0360043516610ace565b341561023257600080fd5b61027860046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b1095505050505050565b60405180806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156102bd5780820151838201526020016102a5565b50505050905090810190601f1680156102ea5780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b83811015610320578082015183820152602001610308565b50505050905090810190601f16801561034d5780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b8381101561038357808201518382015260200161036b565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34156103cd57600080fd5b61041360046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e7495505050505050565b604051901515815260200160405180910390f35b341561043257600080fd5b6100e3600160a060020a0360043516610ee6565b60005433600160a060020a039081169116148061047b5750600160a060020a03331660009081526001602052604090205460ff165b151561048657600080fd5b6000600360026000846040518082805190602001908083835b602083106104be5780518252601f19909201916020918201910161049f565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390208152602081019190915260409081016000206001019051808280546001816001161561010002031660029004801561055a5780601f1061053857610100808354040283529182019161055a565b820191906000526020600020905b815481529060010190602001808311610546575b50509283525050602001604051908190039020805460ff191691151591909117905560026000826040518082805190602001908083835b602083106105b05780518252601f199092019160209182019101610591565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390208152602081019190915260400160009081206105f891610f30565b60026000826040518082805190602001908083835b6020831061062c5780518252601f19909201916020918201910161060d565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060001916600019168152602001908152602001600020600101600061067d9190610f30565b60026000826040518082805190602001908083835b602083106106b15780518252601f199092019160209182019101610692565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060020160006107029190610f30565b7f7b6d36b11079da6c6a954e6a0790a233fb12d452c49b8ba023ac3a19829793618160405160208082528190810183818151815260200191508051906020019080838360005b83811015610760578082015183820152602001610748565b50505050905090810190601f16801561078d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b60005433600160a060020a039081169116146107b857600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b600054600160a060020a031681565b60005433600160a060020a039081169116148061081d5750600160a060020a03331660009081526001602052604090205460ff165b151561082857600080fd5b8260026000856040518082805190602001908083835b6020831061085d5780518252601f19909201916020918201910161083e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020815260208101919091526040016000209080516108ab929160200190610f77565b508160026000856040518082805190602001908083835b602083106108e15780518252601f1990920191602091820191016108c2565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902081526020810191909152604001600020600101908051610932929160200190610f77565b508060026000856040518082805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020815260208101919091526040016000206002019080516109b9929160200190610f77565b5060016003836040518082805190602001908083835b602083106109ee5780518252601f1990920191602091820191016109cf565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020805460ff19169115159190911790557f8b5990d705f635a0482a4e48116f8fb0b728d90317aa3db1ec664a951f432ece8360405160208082528190810183818151815260200191508051906020019080838360005b83811015610a8f578082015183820152602001610a77565b50505050905090810190601f168015610abc5780820380516001836020036101000a031916815260200191505b509250505060405180910390a1505050565b60005433600160a060020a03908116911614610ae957600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b610b18610ff5565b610b20610ff5565b610b28610ff5565b60026000856040518082805190602001908083835b60208310610b5c5780518252601f199092019160209182019101610b3d565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060000160026000866040518082805190602001908083835b60208310610bd55780518252601f199092019160209182019101610bb6565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390206000191660001916815260200190815260200160002060010160026000876040518082805190602001908083835b60208310610c4e5780518252601f199092019160209182019101610c2f565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060001916600019168152602001908152602001600020600201828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d285780601f10610cfd57610100808354040283529160200191610d28565b820191906000526020600020905b815481529060010190602001808311610d0b57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b50505050509150808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e605780601f10610e3557610100808354040283529160200191610e60565b820191906000526020600020905b815481529060010190602001808311610e4357829003601f168201915b505050505090509250925092509193909250565b60006003826040518082805190602001908083835b60208310610ea85780518252601f199092019160209182019101610e89565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040519081900390205460ff1692915050565b60005433600160a060020a03908116911614610f0157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b50805460018160011615610100020316600290046000825580601f10610f565750610f74565b601f016020900490600052602060002090810190610f749190611007565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610fb857805160ff1916838001178555610fe5565b82800160010185558215610fe5579182015b82811115610fe5578251825591602001919060010190610fca565b50610ff1929150611007565b5090565b60206040519081016040526000815290565b61102191905b80821115610ff1576000815560010161100d565b905600a165627a7a723058204d7be79e6022fe316e6c1132408f31a878059144b0e1b07806932dc2ae4007c30029