Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 554 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Submit Vote | 5340686 | 360 days ago | IN | 0 ETH | 0.00000341 | ||||
Submit Vote | 5340674 | 360 days ago | IN | 0 ETH | 0.00000265 | ||||
Submit Model | 5340670 | 360 days ago | IN | 0 ETH | 0.00001285 | ||||
Submit Vote | 5340607 | 360 days ago | IN | 0 ETH | 0.00000096 | ||||
Submit Vote | 5340606 | 360 days ago | IN | 0 ETH | 0.000001 | ||||
Submit Vote | 5340605 | 360 days ago | IN | 0 ETH | 0.00000098 | ||||
Register Partici... | 5340592 | 360 days ago | IN | 0 ETH | 0.00000262 | ||||
Register Partici... | 5340536 | 360 days ago | IN | 0 ETH | 0.00000348 | ||||
Submit Vote | 5335175 | 361 days ago | IN | 0 ETH | 0.00267074 | ||||
Submit Vote | 5335175 | 361 days ago | IN | 0 ETH | 0.00282684 | ||||
Submit Vote | 5335174 | 361 days ago | IN | 0 ETH | 0.00271156 | ||||
Submit Vote | 5335174 | 361 days ago | IN | 0 ETH | 0.00287004 | ||||
Submit Vote | 5335173 | 361 days ago | IN | 0 ETH | 0.00298233 | ||||
Submit Vote | 5335173 | 361 days ago | IN | 0 ETH | 0.00298233 | ||||
Submit Vote | 5335155 | 361 days ago | IN | 0 ETH | 0.00317938 | ||||
Submit Vote | 5335154 | 361 days ago | IN | 0 ETH | 0.00324946 | ||||
Submit Vote | 5335153 | 361 days ago | IN | 0 ETH | 0.00309521 | ||||
Submit Vote | 5335153 | 361 days ago | IN | 0 ETH | 0.00309521 | ||||
Submit Model | 5335152 | 361 days ago | IN | 0 ETH | 0.0138707 | ||||
Submit Model | 5335152 | 361 days ago | IN | 0 ETH | 0.0138707 | ||||
Submit Vote | 5335135 | 361 days ago | IN | 0 ETH | 0.00311275 | ||||
Submit Model | 5335134 | 361 days ago | IN | 0 ETH | 0.01588299 | ||||
Submit Vote | 5334944 | 361 days ago | IN | 0 ETH | 0.00147881 | ||||
Submit Vote | 5334944 | 361 days ago | IN | 0 ETH | 0.00149109 | ||||
Submit Vote | 5334942 | 361 days ago | IN | 0 ETH | 0.00161619 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xDc2E453a...14337ea9e The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DiffFL
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8; contract DiffFL{ address public owner; uint model_submissions = 0; uint participantsCount=0; string [] participantTypes = ["trainer", "evaluator", "both"]; struct modelCard{ string CID; address author; uint32 votes; } struct participants{ address participantAddress; uint participantType; uint models_submitted; } mapping(uint => modelCard) public modelInfo; //this is where we store the info for each model submission mapping(uint => participants) public participantInfo; //this is where we store the info for each registered participant mapping(address => uint) public participantIDbyAddress; //maps addresses to ids so that you can get info about a participant using their address mapping(address => bool) public registeredNodes; event participantRegistered(uint participantID, uint participantType, address participant); event modelSubmitted(uint id, string CID, address author); event modelVoted(uint id, string CID, address voter); constructor() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner, "Only the contract owner can call this function."); _; } modifier onlyRegisteredNodes() { require(registeredNodes[msg.sender], "Only registered nodes can call this function."); _; } function submitModel(string memory CID) public returns(uint) { uint model_submission_id=model_submissions; modelInfo[model_submission_id]=modelCard(CID, msg.sender, 0); emit modelSubmitted(model_submission_id, CID, msg.sender); model_submissions+=1; uint participantID=participantIDbyAddress[msg.sender]; participantInfo[participantID].models_submitted+=1; return model_submission_id; } function submitVote(uint id) public { modelInfo[id].votes+=1; //here we can add some sort of check to prevent people voting too many times in a short timespan emit modelVoted(id, modelInfo[id].CID, msg.sender); } function getModelInfo(uint id) public view returns (modelCard memory){ return modelInfo[id]; } function registerParticipant(uint participantType) public { participantInfo[participantsCount]=participants(msg.sender, participantType, 0); participantIDbyAddress[msg.sender]=participantsCount; registeredNodes[msg.sender] = true; emit participantRegistered(participantsCount, participantType, msg.sender); participantsCount+=1; } function getParticipantInfoByID(uint id) public view returns (participants memory) { return participantInfo[id]; } function getParticipantsInfoByAddress(address participant) public view returns (participants memory) { uint participantID=participantIDbyAddress[participant]; return participantInfo[participantID]; } function getParticipantTypes(uint id) public view returns (string memory) { return participantTypes[id]; } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"CID","type":"string"},{"indexed":false,"internalType":"address","name":"author","type":"address"}],"name":"modelSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"CID","type":"string"},{"indexed":false,"internalType":"address","name":"voter","type":"address"}],"name":"modelVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"participantID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"participantType","type":"uint256"},{"indexed":false,"internalType":"address","name":"participant","type":"address"}],"name":"participantRegistered","type":"event"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getModelInfo","outputs":[{"components":[{"internalType":"string","name":"CID","type":"string"},{"internalType":"address","name":"author","type":"address"},{"internalType":"uint32","name":"votes","type":"uint32"}],"internalType":"struct DiffFL.modelCard","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getParticipantInfoByID","outputs":[{"components":[{"internalType":"address","name":"participantAddress","type":"address"},{"internalType":"uint256","name":"participantType","type":"uint256"},{"internalType":"uint256","name":"models_submitted","type":"uint256"}],"internalType":"struct DiffFL.participants","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getParticipantTypes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"participant","type":"address"}],"name":"getParticipantsInfoByAddress","outputs":[{"components":[{"internalType":"address","name":"participantAddress","type":"address"},{"internalType":"uint256","name":"participantType","type":"uint256"},{"internalType":"uint256","name":"models_submitted","type":"uint256"}],"internalType":"struct DiffFL.participants","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"modelInfo","outputs":[{"internalType":"string","name":"CID","type":"string"},{"internalType":"address","name":"author","type":"address"},{"internalType":"uint32","name":"votes","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"participantIDbyAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"participantInfo","outputs":[{"internalType":"address","name":"participantAddress","type":"address"},{"internalType":"uint256","name":"participantType","type":"uint256"},{"internalType":"uint256","name":"models_submitted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"participantType","type":"uint256"}],"name":"registerParticipant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"registeredNodes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"CID","type":"string"}],"name":"submitModel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"submitVote","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106100b2575f3560e01c80638da5cb5b1161006f5780638da5cb5b146101ae578063d3d1fb48146101cc578063da1db9b5146101fc578063da249db11461022e578063efb66ee814610260578063f6319ea814610290576100b2565b80631d8131b7146100b65780632844328f146100e6578063302aaad11461010257806353703f5c14610132578063730f919d1461014e57806375f7e7ec1461017e575b5f80fd5b6100d060048036038101906100cb9190610c27565b6102c0565b6040516100dd9190610cb9565b60405180910390f35b61010060048036038101906100fb9190610cfc565b610395565b005b61011c60048036038101906101179190610c27565b610437565b6040516101299190610d36565b60405180910390f35b61014c60048036038101906101479190610cfc565b61044c565b005b61016860048036038101906101639190610e8b565b6105dd565b6040516101759190610d36565b60405180910390f35b61019860048036038101906101939190610cfc565b610779565b6040516101a59190610cb9565b60405180910390f35b6101b661080c565b6040516101c39190610ee1565b60405180910390f35b6101e660048036038101906101e19190610c27565b61082f565b6040516101f39190610f14565b60405180910390f35b61021660048036038101906102119190610cfc565b61084c565b60405161022593929190610fc5565b60405180910390f35b61024860048036038101906102439190610cfc565b610927565b60405161025793929190611001565b60405180910390f35b61027a60048036038101906102759190610cfc565b61096c565b60405161028791906110da565b60405180910390f35b6102aa60048036038101906102a59190610cfc565b610aa1565b6040516102b791906110fa565b60405180910390f35b6102c8610b4d565b5f60065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905060055f8281526020019081526020015f206040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050915050919050565b600160045f8381526020019081526020015f2060010160148282829054906101000a900463ffffffff166103c99190611147565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f844e5f4ddadfa772c65e7667eda7812a576b65cae2913f1964c4617bbfbae3f98160045f8481526020019081526020015f205f013360405161042c9392919061126e565b60405180910390a150565b6006602052805f5260405f205f915090505481565b60405180606001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020015f81525060055f60025481526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015590505060025460065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160075f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055507f8e8bf31751ee0af0dfbd5cd138bd34b05a019005374e264634b5a41a697cd94960025482336040516105b9939291906112aa565b60405180910390a1600160025f8282546105d391906112df565b9250508190555050565b5f80600154905060405180606001604052808481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020015f63ffffffff1681525060045f8381526020019081526020015f205f820151815f01908161063f919061149d565b506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160146101000a81548163ffffffff021916908363ffffffff1602179055509050507f250b302827f56310152f83b467320f9b90bad53e9e12bdf9afe12090483c2fb88184336040516106e39392919061156c565b60405180910390a16001805f8282546106fc91906112df565b925050819055505f60065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050600160055f8381526020019081526020015f206002015f82825461076891906112df565b925050819055508192505050919050565b610781610b4d565b60055f8381526020019081526020015f206040518060600160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815250509050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6007602052805f5260405f205f915054906101000a900460ff1681565b6004602052805f5260405f205f91509050805f01805461086b906111ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610897906111ab565b80156108e25780601f106108b9576101008083540402835291602001916108e2565b820191905f5260205f20905b8154815290600101906020018083116108c557829003601f168201915b505050505090806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160149054906101000a900463ffffffff16905083565b6005602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154905083565b610974610b81565b60045f8381526020019081526020015f206040518060600160405290815f8201805461099f906111ab565b80601f01602080910402602001604051908101604052809291908181526020018280546109cb906111ab565b8015610a165780601f106109ed57610100808354040283529160200191610a16565b820191905f5260205f20905b8154815290600101906020018083116109f957829003601f168201915b50505050508152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900463ffffffff1663ffffffff1663ffffffff16815250509050919050565b606060038281548110610ab757610ab66115a8565b5b905f5260205f20018054610aca906111ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610af6906111ab565b8015610b415780601f10610b1857610100808354040283529160200191610b41565b820191905f5260205f20905b815481529060010190602001808311610b2457829003601f168201915b50505050509050919050565b60405180606001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81525090565b6040518060600160405280606081526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f63ffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610bf682610bcd565b9050919050565b610c0681610bec565b8114610c10575f80fd5b50565b5f81359050610c2181610bfd565b92915050565b5f60208284031215610c3c57610c3b610bc5565b5b5f610c4984828501610c13565b91505092915050565b610c5b81610bec565b82525050565b5f819050919050565b610c7381610c61565b82525050565b606082015f820151610c8d5f850182610c52565b506020820151610ca06020850182610c6a565b506040820151610cb36040850182610c6a565b50505050565b5f606082019050610ccc5f830184610c79565b92915050565b610cdb81610c61565b8114610ce5575f80fd5b50565b5f81359050610cf681610cd2565b92915050565b5f60208284031215610d1157610d10610bc5565b5b5f610d1e84828501610ce8565b91505092915050565b610d3081610c61565b82525050565b5f602082019050610d495f830184610d27565b92915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610d9d82610d57565b810181811067ffffffffffffffff82111715610dbc57610dbb610d67565b5b80604052505050565b5f610dce610bbc565b9050610dda8282610d94565b919050565b5f67ffffffffffffffff821115610df957610df8610d67565b5b610e0282610d57565b9050602081019050919050565b828183375f83830152505050565b5f610e2f610e2a84610ddf565b610dc5565b905082815260208101848484011115610e4b57610e4a610d53565b5b610e56848285610e0f565b509392505050565b5f82601f830112610e7257610e71610d4f565b5b8135610e82848260208601610e1d565b91505092915050565b5f60208284031215610ea057610e9f610bc5565b5b5f82013567ffffffffffffffff811115610ebd57610ebc610bc9565b5b610ec984828501610e5e565b91505092915050565b610edb81610bec565b82525050565b5f602082019050610ef45f830184610ed2565b92915050565b5f8115159050919050565b610f0e81610efa565b82525050565b5f602082019050610f275f830184610f05565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610f64578082015181840152602081019050610f49565b5f8484015250505050565b5f610f7982610f2d565b610f838185610f37565b9350610f93818560208601610f47565b610f9c81610d57565b840191505092915050565b5f63ffffffff82169050919050565b610fbf81610fa7565b82525050565b5f6060820190508181035f830152610fdd8186610f6f565b9050610fec6020830185610ed2565b610ff96040830184610fb6565b949350505050565b5f6060820190506110145f830186610ed2565b6110216020830185610d27565b61102e6040830184610d27565b949350505050565b5f82825260208201905092915050565b5f61105082610f2d565b61105a8185611036565b935061106a818560208601610f47565b61107381610d57565b840191505092915050565b61108781610fa7565b82525050565b5f606083015f8301518482035f8601526110a78282611046565b91505060208301516110bc6020860182610c52565b5060408301516110cf604086018261107e565b508091505092915050565b5f6020820190508181035f8301526110f2818461108d565b905092915050565b5f6020820190508181035f8301526111128184610f6f565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61115182610fa7565b915061115c83610fa7565b9250828201905063ffffffff8111156111785761117761111a565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806111c257607f821691505b6020821081036111d5576111d461117e565b5b50919050565b5f819050815f5260205f209050919050565b5f81546111f9816111ab565b6112038186610f37565b9450600182165f811461121d576001811461123357611265565b60ff198316865281151560200286019350611265565b61123c856111db565b5f5b8381101561125d5781548189015260018201915060208101905061123e565b808801955050505b50505092915050565b5f6060820190506112815f830186610d27565b818103602083015261129381856111ed565b90506112a26040830184610ed2565b949350505050565b5f6060820190506112bd5f830186610d27565b6112ca6020830185610d27565b6112d76040830184610ed2565b949350505050565b5f6112e982610c61565b91506112f483610c61565b925082820190508082111561130c5761130b61111a565b5b92915050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830261135c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611321565b6113668683611321565b95508019841693508086168417925050509392505050565b5f819050919050565b5f6113a161139c61139784610c61565b61137e565b610c61565b9050919050565b5f819050919050565b6113ba83611387565b6113ce6113c6826113a8565b84845461132d565b825550505050565b5f90565b6113e26113d6565b6113ed8184846113b1565b505050565b5b81811015611410576114055f826113da565b6001810190506113f3565b5050565b601f82111561145557611426816111db565b61142f84611312565b8101602085101561143e578190505b61145261144a85611312565b8301826113f2565b50505b505050565b5f82821c905092915050565b5f6114755f198460080261145a565b1980831691505092915050565b5f61148d8383611466565b9150826002028217905092915050565b6114a682610f2d565b67ffffffffffffffff8111156114bf576114be610d67565b5b6114c982546111ab565b6114d4828285611414565b5f60209050601f831160018114611505575f84156114f3578287015190505b6114fd8582611482565b865550611564565b601f198416611513866111db565b5f5b8281101561153a57848901518255600182019150602085019450602081019050611515565b868310156115575784890151611553601f891682611466565b8355505b6001600288020188555050505b505050505050565b5f60608201905061157f5f830186610d27565b81810360208301526115918185610f6f565b90506115a06040830184610ed2565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212203aaeaaa7aa4c997f64716a8370a4ea56d3120c1f837fe7cfa27bb4f75e70727764736f6c63430008160033
Loading...
Loading
[ 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.