Contract Overview
Balance:
0 MATIC
My Name Tag:
Not Available
[ Download CSV Export ]
Contract Name:
DiaOracle
Compiler Version
v0.4.25+commit.59dbf8f1
Contract Source Code (Solidity)
/** *Submitted for verification at polygonscan.com on 2021-09-09 */ /** *Submitted for verification at Etherscan.io on 2018-10-25 */ pragma solidity ^0.4.21; contract DiaOracle { address owner; struct CoinInfo { uint256 price; uint256 supply; uint256 lastUpdateTimestamp; string symbol; } mapping(string => CoinInfo) diaOracles; event newCoinInfo( string name, string symbol, uint256 price, uint256 supply, uint256 lastUpdateTimestamp ); constructor() public { owner = msg.sender; } function changeOwner(address newOwner) public { require(msg.sender == owner); owner = newOwner; } function updateCoinInfo(string name, string symbol, uint256 newPrice, uint256 newSupply, uint256 newTimestamp) public { require(msg.sender == owner); diaOracles[name] = (CoinInfo(newPrice, newSupply, newTimestamp, symbol)); emit newCoinInfo(name, symbol, newPrice, newSupply, newTimestamp); } function getCoinInfo(string name) public view returns (uint256, uint256, uint256, string) { return ( diaOracles[name].price, diaOracles[name].supply, diaOracles[name].lastUpdateTimestamp, diaOracles[name].symbol ); } }
[{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"symbol","type":"string"},{"name":"newPrice","type":"uint256"},{"name":"newSupply","type":"uint256"},{"name":"newTimestamp","type":"uint256"}],"name":"updateCoinInfo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"}],"name":"getCoinInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"symbol","type":"string"},{"indexed":false,"name":"price","type":"uint256"},{"indexed":false,"name":"supply","type":"uint256"},{"indexed":false,"name":"lastUpdateTimestamp","type":"uint256"}],"name":"newCoinInfo","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b5060008054600160a060020a0319163317905561076c806100326000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166345cc0a2f811461005b578063a6f9dae114610101578063e12214001461012f575b600080fd5b34801561006757600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526100ff94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750508435955050506020830135926040013591506102159050565b005b34801561010d57600080fd5b506100ff73ffffffffffffffffffffffffffffffffffffffff6004351661040d565b34801561013b57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261018894369492936024939284019190819084018382808284375094975061046d9650505050505050565b6040518085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156101d75781810151838201526020016101bf565b50505050905090810190601f1680156102045780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b60005473ffffffffffffffffffffffffffffffffffffffff16331461023957600080fd5b608060405190810160405280848152602001838152602001828152602001858152506001866040518082805190602001908083835b6020831061028d5780518252601f19909201916020918201910161026e565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820190942085518155858201516001820155938501516002850155606085015180516102ea94506003860193509101906106a5565b509050507f8d468b5f823f8d38322e9c4433d184adf453fd3eaa28cef280056aa0664981f08585858585604051808060200180602001868152602001858152602001848152602001838103835288818151815260200191508051906020019080838360005b8381101561036757818101518382015260200161034f565b50505050905090810190601f1680156103945780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b838110156103c75781810151838201526020016103af565b50505050905090810190601f1680156103f45780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a15050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461043157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600080600060606001856040518082805190602001908083835b602083106104a65780518252601f199092019160209182019101610487565b51815160209384036101000a600019018019909216911617905292019485525060405193849003810184205489519094600194508a9350918291908401908083835b602083106105075780518252601f1990920191602091820191016104e8565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600101546001876040518082805190602001908083835b602083106105705780518252601f199092019160209182019101610551565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420600201548b519094600194508c9350918291908401908083835b602083106105d45780518252601f1990920191602091820191016105b5565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188206003018054601f60026001831615909802909501169590950492830182900482028801820190528187529295945085935091840190508282801561068f5780601f106106645761010080835404028352916020019161068f565b820191906000526020600020905b81548152906001019060200180831161067257829003601f168201915b5050505050905093509350935093509193509193565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106106e657805160ff1916838001178555610713565b82800160010185558215610713579182015b828111156107135782518255916020019190600101906106f8565b5061071f929150610723565b5090565b61073d91905b8082111561071f5760008155600101610729565b905600a165627a7a72305820c8712ca2f191c931fcbf0027a8be3145627a0182919794b4d7cd81dcbe3655e80029
Deployed ByteCode Sourcemap
99:1057:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;601:303;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;601:303:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;601:303:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;601:303:0;;;;-1:-1:-1;601:303:0;-1:-1:-1;601:303:0;;-1:-1:-1;601:303:0;;;;;;;;-1:-1:-1;601:303:0;;-1:-1:-1;;601:303:0;;;-1:-1:-1;;;601:303:0;;;;;;;;;-1:-1:-1;601:303:0;;-1:-1:-1;601:303:0;;;487:105;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;487:105:0;;;;;;;913:240;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;913:240:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;913:240:0;;-1:-1:-1;913:240:0;;-1:-1:-1;;;;;;;913:240:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;913:240:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;601:303;746:5;;;;732:10;:19;724:28;;;;;;777:51;;;;;;;;;786:8;777:51;;;;796:9;777:51;;;;807:12;777:51;;;;821:6;777:51;;;757:10;768:4;757:16;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;757:16:0;;;;;-1:-1:-1;757:16:0;;;;;;;;;;;;:72;;;;;;;;274:1:-1;757:72:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;757:72:0;;;;-1:-1:-1;757:72:0;;;;:::i;:::-;;;;;839:60;851:4;857:6;865:8;875:9;886:12;839:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;839:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;839:60:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;839:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;601:303;;;;;:::o;487:105::-;560:5;;;;546:10;:19;538:28;;;;;;571:5;:16;;-1:-1:-1;;571:16:0;;;;;;;;;;;;487:105::o;913:240::-;968:7;977;986;995:6;1021:10;1032:4;1021:16;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1021:16:0;;;;;-1:-1:-1;1021:16:0;;;;;;;;;;:22;1049:16;;1021:22;;274:1:-1;;-1:-1;1049:16:0;;-1:-1:-1;1021:16:0;;;1049;;;;;1021;1049;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1049:16:0;;;;;;;;;;;;;;;;;;;;;:23;;;1078:10;1089:4;1078:16;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1078:16:0;;;;;-1:-1:-1;1078:16:0;;;;;;;;;;:36;;;1120:16;;1078:36;;274:1:-1;;-1:-1;1120:16:0;;-1:-1:-1;1078:16:0;;;1120;;;;;1078;1120;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;-1:-1;;263:2;259:12;;;254:3;250:22;;;246:30;;340:21;;;311:9;;295:26;;;;377:20;;;;365:33;;;1120:16:0;;;;;;;;;;;;;;;;;;:23;;1008:140;;;;274:1:-1;1008:140:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1120:23;;:16;-1:-1:-1;1120:23:0;;-1:-1:-1;1008:140:0;;;;-1:-1:-1;1120:23:0;1008:140;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;913:240;;;;;:::o;99:1057::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;99:1057:0;;;-1:-1:-1;99:1057:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o
Swarm Source
bzzr://c8712ca2f191c931fcbf0027a8be3145627a0182919794b4d7cd81dcbe3655e8
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|