Contract Address Details

0x3FBfA1a0F44dB25f55c4370156227dDb2576f48E

Contract Name
Dao
Creator
0x1ab0be–a08329 at 0xabbd0e–69742e
Balance
0 TT ( )
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
4468224
Contract name:
Dao




Optimization enabled
false
Compiler version
v0.8.0+commit.c7dfd78e




EVM Version
default




Verified at
2024-03-23 15:06:30.740492Z

Contract source code

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract Dao {
// dao member => role => rater => rate
mapping(address => mapping(string => mapping(address => uint8))) public ratings;
// all members of the dao
address[] public members;
mapping(address => bool) public isMember;
// roles of a given dao member
string[] public roles;
mapping(string => bool) public roleExists;
function addMember(address member) public {
if (isMember[member] == false) {
isMember[member] = true;
members.push(member);
}
}
function addRole(string memory role) public {
if (roleExists[role] == false) {
roleExists[role] = true;
roles.push(role);
}
}
function rateMember(address ratee, string memory role, address rater, uint8 rating) public {
ratings[ratee][role][rater] = rating;
}
// Function to get the length of members array
function getMembersCount() public view returns (uint256) {
return members.length;
}
// Function to get the length of roles array
function getRolesCount() public view returns (uint256) {
return roles.length;
}
}

Contract ABI

[{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMember","inputs":[{"type":"address","name":"member","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRole","inputs":[{"type":"string","name":"role","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMembersCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRolesCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMember","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"members","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rateMember","inputs":[{"type":"address","name":"ratee","internalType":"address"},{"type":"string","name":"role","internalType":"string"},{"type":"address","name":"rater","internalType":"address"},{"type":"uint8","name":"rating","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"ratings","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"roleExists","inputs":[{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"roles","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80639ef215c9116100665780639ef215c91461015b578063a230c52414610177578063bfda4a49146101a7578063ca6d56dc146101d7578063d00cce41146101f35761009e565b806303bb915f146100a357806309772f8f146100d35780633e96e868146100f15780635daf08ca1461010d5780637fccc2481461013d575b600080fd5b6100bd60048036038101906100b891906107c0565b610223565b6040516100ca9190610a3c565b60405180910390f35b6100db610275565b6040516100e89190610a21565b60405180910390f35b61010b600480360381019061010691906108a2565b610282565b005b610127600480360381019061012291906108e3565b610331565b60405161013491906109c9565b60405180910390f35b610145610370565b6040516101529190610a21565b60405180910390f35b61017560048036038101906101709190610827565b61037d565b005b610191600480360381019061018c9190610797565b610433565b60405161019e91906109e4565b60405180910390f35b6101c160048036038101906101bc91906108e3565b610453565b6040516101ce91906109ff565b60405180910390f35b6101f160048036038101906101ec9190610797565b6104ff565b005b61020d600480360381019061020891906108a2565b610617565b60405161021a91906109e4565b60405180910390f35b600060205282600052604060002082805160208101820180518482526020830160208501208183528095505050505050602052806000526040600020600092509250509054906101000a900460ff1681565b6000600180549050905090565b6000151560048260405161029691906109b2565b908152602001604051809103902060009054906101000a900460ff161515141561032e5760016004826040516102cc91906109b2565b908152602001604051809103902060006101000a81548160ff02191690831515021790555060038190806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061032c92919061064d565b505b50565b6001818154811061034157600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600380549050905090565b806000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516103ca91906109b2565b908152602001604051809103902060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff16021790555050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b6003818154811061046357600080fd5b90600052602060002001600091509050805461047e90610b76565b80601f01602080910402602001604051908101604052809291908181526020018280546104aa90610b76565b80156104f75780601f106104cc576101008083540402835291602001916104f7565b820191906000526020600020905b8154815290600101906020018083116104da57829003601f168201915b505050505081565b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610614576001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6004818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900460ff1681565b82805461065990610b76565b90600052602060002090601f01602090048101928261067b57600085556106c2565b82601f1061069457805160ff19168380011785556106c2565b828001600101855582156106c2579182015b828111156106c15782518255916020019190600101906106a6565b5b5090506106cf91906106d3565b5090565b5b808211156106ec5760008160009055506001016106d4565b5090565b60006107036106fe84610a88565b610a57565b90508281526020810184848401111561071b57600080fd5b610726848285610b34565b509392505050565b60008135905061073d81610c17565b92915050565b600082601f83011261075457600080fd5b81356107648482602086016106f0565b91505092915050565b60008135905061077c81610c2e565b92915050565b60008135905061079181610c45565b92915050565b6000602082840312156107a957600080fd5b60006107b78482850161072e565b91505092915050565b6000806000606084860312156107d557600080fd5b60006107e38682870161072e565b935050602084013567ffffffffffffffff81111561080057600080fd5b61080c86828701610743565b925050604061081d8682870161072e565b9150509250925092565b6000806000806080858703121561083d57600080fd5b600061084b8782880161072e565b945050602085013567ffffffffffffffff81111561086857600080fd5b61087487828801610743565b93505060406108858782880161072e565b925050606061089687828801610782565b91505092959194509250565b6000602082840312156108b457600080fd5b600082013567ffffffffffffffff8111156108ce57600080fd5b6108da84828501610743565b91505092915050565b6000602082840312156108f557600080fd5b60006109038482850161076d565b91505092915050565b61091581610adf565b82525050565b61092481610af1565b82525050565b600061093582610ab8565b61093f8185610ac3565b935061094f818560208601610b43565b61095881610c06565b840191505092915050565b600061096e82610ab8565b6109788185610ad4565b9350610988818560208601610b43565b80840191505092915050565b61099d81610b1d565b82525050565b6109ac81610b27565b82525050565b60006109be8284610963565b915081905092915050565b60006020820190506109de600083018461090c565b92915050565b60006020820190506109f9600083018461091b565b92915050565b60006020820190508181036000830152610a19818461092a565b905092915050565b6000602082019050610a366000830184610994565b92915050565b6000602082019050610a5160008301846109a3565b92915050565b6000604051905081810181811067ffffffffffffffff82111715610a7e57610a7d610bd7565b5b8060405250919050565b600067ffffffffffffffff821115610aa357610aa2610bd7565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000610aea82610afd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015610b61578082015181840152602081019050610b46565b83811115610b70576000848401525b50505050565b60006002820490506001821680610b8e57607f821691505b60208210811415610ba257610ba1610ba8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610c2081610adf565b8114610c2b57600080fd5b50565b610c3781610b1d565b8114610c4257600080fd5b50565b610c4e81610b27565b8114610c5957600080fd5b5056fea2646970667358221220f373667163b7e407a6a88fa8cee4ed350757f06d67333ad2cce6b322da0af83964736f6c63430008000033