Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 5668659 | 2863 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RightAndRoles
Compiler Version
v0.4.21+commit.dfe3193c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-05-24
*/
// Project: AleHub
// v1, 2018-05-24
// This code is the property of CryptoB2B.io
// Copying in whole or in part is prohibited.
// Authors: Ivan Fedorov and Dmitry Borodin
// Do you want the same TokenSale platform? www.cryptob2b.io
// *.sol in 1 file - https://cryptob2b.io/solidity/alehub/
pragma solidity ^0.4.21;
contract IRightAndRoles {
address[][] public wallets;
mapping(address => uint16) public roles;
event WalletChanged(address indexed newWallet, address indexed oldWallet, uint8 indexed role);
event CloneChanged(address indexed wallet, uint8 indexed role, bool indexed mod);
function changeWallet(address _wallet, uint8 _role) external;
function setManagerPowerful(bool _mode) external;
function onlyRoles(address _sender, uint16 _roleMask) view external returns(bool);
}
contract RightAndRoles is IRightAndRoles {
bool managerPowerful = true;
function RightAndRoles(address[] _roles) public {
uint8 len = uint8(_roles.length);
require(len > 0&&len <16);
wallets.length = len;
for(uint8 i = 0; i < len; i++){
wallets[i].push(_roles[i]);
roles[_roles[i]] += uint16(2)**i;
emit WalletChanged(_roles[i], address(0),i);
}
}
function changeClons(address _clon, uint8 _role, bool _mod) external {
require(wallets[_role][0] == msg.sender&&_clon != msg.sender);
emit CloneChanged(_clon,_role,_mod);
uint16 roleMask = uint16(2)**_role;
if(_mod){
require(roles[_clon]&roleMask == 0);
wallets[_role].push(_clon);
}else{
address[] storage tmp = wallets[_role];
uint8 i = 1;
for(i; i < tmp.length; i++){
if(tmp[i] == _clon) break;
}
require(i > tmp.length);
tmp[i] = tmp[tmp.length];
delete tmp[tmp.length];
}
roles[_clon] = _mod?roles[_clon]|roleMask:roles[_clon]&~roleMask;
}
// Change the address for the specified role.
// Available to any wallet owner except the observer.
// Available to the manager until the round is initialized.
// The Observer's wallet or his own manager can change at any time.
// @ Do I have to use the function no
// @ When it is possible to call depend...
// @ When it is launched automatically -
// @ Who can call the function staff (all 7+ roles)
function changeWallet(address _wallet, uint8 _role) external {
require(wallets[_role][0] == msg.sender || wallets[0][0] == msg.sender || (wallets[1][0] == msg.sender && managerPowerful /* && _role != 0*/));
emit WalletChanged(wallets[_role][0],_wallet,_role);
uint16 roleMask = uint16(2)**_role;
address[] storage tmp = wallets[_role];
for(uint8 i = 0; i < tmp.length; i++){
roles[tmp[i]] = roles[tmp[i]]&~roleMask;
}
delete wallets[_role];
tmp.push(_wallet);
roles[_wallet] = roles[_wallet]|roleMask;
}
function setManagerPowerful(bool _mode) external {
require(wallets[0][0] == msg.sender);
managerPowerful = _mode;
}
function onlyRoles(address _sender, uint16 _roleMask) view external returns(bool) {
return roles[_sender]&_roleMask != 0;
}
function getMainWallets() view external returns(address[]){
address[] memory _wallets = new address[](wallets.length);
for(uint8 i = 0; i<wallets.length; i++){
_wallets[i] = wallets[i][0];
}
return _wallets;
}
function getCloneWallets(uint8 _role) view external returns(address[]){
return wallets[_role];
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"wallets","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMainWallets","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_wallet","type":"address"},{"name":"_role","type":"uint8"}],"name":"changeWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_clon","type":"address"},{"name":"_role","type":"uint8"},{"name":"_mod","type":"bool"}],"name":"changeClons","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"roles","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_roleMask","type":"uint16"}],"name":"onlyRoles","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_mode","type":"bool"}],"name":"setManagerPowerful","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_role","type":"uint8"}],"name":"getCloneWallets","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_roles","type":"address[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"newWallet","type":"address"},{"indexed":true,"name":"oldWallet","type":"address"},{"indexed":true,"name":"role","type":"uint8"}],"name":"WalletChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"wallet","type":"address"},{"indexed":true,"name":"role","type":"uint8"},{"indexed":true,"name":"mod","type":"bool"}],"name":"CloneChanged","type":"event"}]Contract Creation Code
60606040526002805460ff1916600117905534156200001d57600080fd5b60405162000cbd38038062000cbd8339810160405280805190910190506000808251915060008260ff1611801562000058575060108260ff16105b15156200006457600080fd5b60ff821662000075600082620001c4565b50600090505b8160ff168160ff161015620001bb576000805460ff83169081106200009c57fe5b6000918252602090912001805460018101620000b98382620001f0565b91600052602060002090016000858460ff1681518110620000d657fe5b90602001906020020151909190916101000a815481600160a060020a030219169083600160a060020a03160217905550508060ff1660020a60016000858460ff16815181106200012257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000908120805461ffff19811661ffff91821694909401169290921790915560ff8216908482815181106200017357fe5b90602001906020020151600160a060020a03167f51cb5d50d59ef136bbdc17f6b0cf7183911a01aed5827ca9c7730cb232792e7d60405160405180910390a46001016200007b565b50505062000286565b815481835581811511620001eb57600083815260209020620001eb91810190830162000217565b505050565b815481835581811511620001eb57600083815260209020620001eb91810190830162000246565b6200024391905b808211156200023f57600062000235828262000263565b506001016200021e565b5090565b90565b6200024391905b808211156200023f57600081556001016200024d565b508054600082559060005260206000209081019062000283919062000246565b50565b610a2780620002966000396000f30060606040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416634152e2eb8114610092578063478573ca146100c75780634cf0afca1461012d57806373e2d75f14610154578063993746421461017e578063b17922f6146101b4578063b92dd395146101ee578063f420c5b114610206575b600080fd5b341561009d57600080fd5b6100ab60043560243561021f565b604051600160a060020a03909116815260200160405180910390f35b34156100d257600080fd5b6100da610261565b60405160208082528190810183818151815260200191508051906020019060200280838360005b83811015610119578082015183820152602001610101565b505050509050019250505060405180910390f35b341561013857600080fd5b610152600160a060020a036004351660ff6024351661031a565b005b341561015f57600080fd5b610152600160a060020a036004351660ff602435166044351515610603565b341561018957600080fd5b61019d600160a060020a036004351661085b565b60405161ffff909116815260200160405180910390f35b34156101bf57600080fd5b6101da600160a060020a036004351661ffff60243516610871565b604051901515815260200160405180910390f35b34156101f957600080fd5b6101526004351515610896565b341561021157600080fd5b6100da60ff600435166108fa565b600080548390811061022d57fe5b90600052602060002090018181548110151561024557fe5b600091825260209091200154600160a060020a03169150829050565b61026961097e565b61027161097e565b600080546040518059106102825750595b90808252806020026020018201604052509150600090505b60005460ff82161015610314576000805460ff83169081106102b857fe5b906000526020600020900160008154811015156102d157fe5b600091825260209091200154600160a060020a03168260ff8316815181106102f557fe5b600160a060020a0390921660209283029091019091015260010161029a565b50919050565b600080600033600160a060020a031660008560ff1681548110151561033b57fe5b9060005260206000209001600081548110151561035457fe5b600091825260209091200154600160a060020a031614806103b9575033600160a060020a031660008081548110151561038957fe5b906000526020600020900160008154811015156103a257fe5b600091825260209091200154600160a060020a0316145b80610416575033600160a060020a0316600060018154811015156103d957fe5b906000526020600020900160008154811015156103f257fe5b600091825260209091200154600160a060020a0316148015610416575060025460ff165b151561042157600080fd5b6000805460ff861691600160a060020a038816918390811061043f57fe5b9060005260206000209001600081548110151561045857fe5b600091825260209091200154600160a060020a03167f51cb5d50d59ef136bbdc17f6b0cf7183911a01aed5827ca9c7730cb232792e7d60405160405180910390a46000805460ff8616600281900a95509081106104b157fe5b60009182526020822001925090505b815460ff8216101561056557821960016000848460ff168154811015156104e357fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120548454921661ffff169160019190859060ff861690811061052457fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805461ffff191661ffff929092169190911790556001016104c0565b6000805460ff861690811061057657fe5b9060005260206000209001600061058d9190610990565b815482906001810161059f83826109b1565b506000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03989098169788179055958152600190955250506040909220805461ffff19811661ffff918216909417169290921790915550565b600080600033600160a060020a031660008660ff1681548110151561062457fe5b9060005260206000209001600081548110151561063d57fe5b600091825260209091200154600160a060020a0316148015610671575033600160a060020a031686600160a060020a031614155b151561067c57600080fd5b8315158560ff1687600160a060020a03167f4130e5a5721483c7b4a34a3241b19d838bc0396bd45a77aff713bb1b139b237f60405160405180910390a48460ff1660020a9250831561075457600160a060020a038616600090815260016020526040902054831661ffff16156106f157600080fd5b6000805460ff871690811061070257fe5b600091825260209091200180546001810161071d83826109b1565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790556107dc565b6000805460ff871690811061076557fe5b90600052602060002090019150600190505b815460ff821610156107c65785600160a060020a0316828260ff1681548110151561079e57fe5b600091825260209091200154600160a060020a031614156107be576107c6565b600101610777565b815460ff8216116107d657600080fd5b81548290fe5b8361080657600160a060020a03861660009081526001602052604090205483191661ffff16610826565b600160a060020a03861660009081526001602052604090205461ffff1683175b600160a060020a03969096166000908152600160205260409020805461ffff191661ffff909716969096179095555050505050565b60016020526000908152604090205461ffff1681565b600160a060020a03919091166000908152600160205260409020541661ffff16151590565b33600160a060020a03166000808154811015156108af57fe5b906000526020600020900160008154811015156108c857fe5b600091825260209091200154600160a060020a0316146108e757600080fd5b6002805460ff1916911515919091179055565b61090261097e565b6000805460ff841690811061091357fe5b906000526020600020900180548060200260200160405190810160405280929190818152602001828054801561097257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610954575b50505050509050919050565b60206040519081016040526000815290565b50805460008255906000526020600020908101906109ae91906109da565b50565b8154818355818115116109d5576000838152602090206109d59181019083016109da565b505050565b6109f891905b808211156109f457600081556001016109e0565b5090565b905600a165627a7a72305820c83d500b45cc7d5642eb87cc3848177f96437dd6b2b73a07e1c6ad9be658cc1d0029000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000080000000000000000000000006aa1990f72c53000aceff1d8934d1ca2802aa1d80000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494000000000000000000000000d228df77af3df82cb7580d48fd0b33fe43a70f0e000000000000000000000000cdd417d7f260b08cd10a3810321df7a40d65ba400000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494000000000000000000000000903b15589855b8c944e9b865a5814d656da16544000000000000000000000000ca2d7c0147fce138736981fb1aa273d89cc9a3bf0000000000000000000000007767b19420c89bb79908820f4a5e55dc65ca7658
Deployed Bytecode
0x60606040526004361061008d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416634152e2eb8114610092578063478573ca146100c75780634cf0afca1461012d57806373e2d75f14610154578063993746421461017e578063b17922f6146101b4578063b92dd395146101ee578063f420c5b114610206575b600080fd5b341561009d57600080fd5b6100ab60043560243561021f565b604051600160a060020a03909116815260200160405180910390f35b34156100d257600080fd5b6100da610261565b60405160208082528190810183818151815260200191508051906020019060200280838360005b83811015610119578082015183820152602001610101565b505050509050019250505060405180910390f35b341561013857600080fd5b610152600160a060020a036004351660ff6024351661031a565b005b341561015f57600080fd5b610152600160a060020a036004351660ff602435166044351515610603565b341561018957600080fd5b61019d600160a060020a036004351661085b565b60405161ffff909116815260200160405180910390f35b34156101bf57600080fd5b6101da600160a060020a036004351661ffff60243516610871565b604051901515815260200160405180910390f35b34156101f957600080fd5b6101526004351515610896565b341561021157600080fd5b6100da60ff600435166108fa565b600080548390811061022d57fe5b90600052602060002090018181548110151561024557fe5b600091825260209091200154600160a060020a03169150829050565b61026961097e565b61027161097e565b600080546040518059106102825750595b90808252806020026020018201604052509150600090505b60005460ff82161015610314576000805460ff83169081106102b857fe5b906000526020600020900160008154811015156102d157fe5b600091825260209091200154600160a060020a03168260ff8316815181106102f557fe5b600160a060020a0390921660209283029091019091015260010161029a565b50919050565b600080600033600160a060020a031660008560ff1681548110151561033b57fe5b9060005260206000209001600081548110151561035457fe5b600091825260209091200154600160a060020a031614806103b9575033600160a060020a031660008081548110151561038957fe5b906000526020600020900160008154811015156103a257fe5b600091825260209091200154600160a060020a0316145b80610416575033600160a060020a0316600060018154811015156103d957fe5b906000526020600020900160008154811015156103f257fe5b600091825260209091200154600160a060020a0316148015610416575060025460ff165b151561042157600080fd5b6000805460ff861691600160a060020a038816918390811061043f57fe5b9060005260206000209001600081548110151561045857fe5b600091825260209091200154600160a060020a03167f51cb5d50d59ef136bbdc17f6b0cf7183911a01aed5827ca9c7730cb232792e7d60405160405180910390a46000805460ff8616600281900a95509081106104b157fe5b60009182526020822001925090505b815460ff8216101561056557821960016000848460ff168154811015156104e357fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120548454921661ffff169160019190859060ff861690811061052457fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805461ffff191661ffff929092169190911790556001016104c0565b6000805460ff861690811061057657fe5b9060005260206000209001600061058d9190610990565b815482906001810161059f83826109b1565b506000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03989098169788179055958152600190955250506040909220805461ffff19811661ffff918216909417169290921790915550565b600080600033600160a060020a031660008660ff1681548110151561062457fe5b9060005260206000209001600081548110151561063d57fe5b600091825260209091200154600160a060020a0316148015610671575033600160a060020a031686600160a060020a031614155b151561067c57600080fd5b8315158560ff1687600160a060020a03167f4130e5a5721483c7b4a34a3241b19d838bc0396bd45a77aff713bb1b139b237f60405160405180910390a48460ff1660020a9250831561075457600160a060020a038616600090815260016020526040902054831661ffff16156106f157600080fd5b6000805460ff871690811061070257fe5b600091825260209091200180546001810161071d83826109b1565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790556107dc565b6000805460ff871690811061076557fe5b90600052602060002090019150600190505b815460ff821610156107c65785600160a060020a0316828260ff1681548110151561079e57fe5b600091825260209091200154600160a060020a031614156107be576107c6565b600101610777565b815460ff8216116107d657600080fd5b81548290fe5b8361080657600160a060020a03861660009081526001602052604090205483191661ffff16610826565b600160a060020a03861660009081526001602052604090205461ffff1683175b600160a060020a03969096166000908152600160205260409020805461ffff191661ffff909716969096179095555050505050565b60016020526000908152604090205461ffff1681565b600160a060020a03919091166000908152600160205260409020541661ffff16151590565b33600160a060020a03166000808154811015156108af57fe5b906000526020600020900160008154811015156108c857fe5b600091825260209091200154600160a060020a0316146108e757600080fd5b6002805460ff1916911515919091179055565b61090261097e565b6000805460ff841690811061091357fe5b906000526020600020900180548060200260200160405190810160405280929190818152602001828054801561097257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610954575b50505050509050919050565b60206040519081016040526000815290565b50805460008255906000526020600020908101906109ae91906109da565b50565b8154818355818115116109d5576000838152602090206109d59181019083016109da565b505050565b6109f891905b808211156109f457600081556001016109e0565b5090565b905600a165627a7a72305820c83d500b45cc7d5642eb87cc3848177f96437dd6b2b73a07e1c6ad9be658cc1d0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000080000000000000000000000006aa1990f72c53000aceff1d8934d1ca2802aa1d80000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494000000000000000000000000d228df77af3df82cb7580d48fd0b33fe43a70f0e000000000000000000000000cdd417d7f260b08cd10a3810321df7a40d65ba400000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494000000000000000000000000903b15589855b8c944e9b865a5814d656da16544000000000000000000000000ca2d7c0147fce138736981fb1aa273d89cc9a3bf0000000000000000000000007767b19420c89bb79908820f4a5e55dc65ca7658
-----Decoded View---------------
Arg [0] : _roles (address[]): 0x6aA1990f72C53000ACeFf1D8934D1CA2802Aa1d8,0x8a91aC199440Da0B45B2E278f3fE616b1bCcC494,0xd228DF77aF3df82cB7580D48FD0b33Fe43A70F0e,0xcDd417d7f260B08CD10a3810321dF7A40D65bA40,0x8a91aC199440Da0B45B2E278f3fE616b1bCcC494,0x903b15589855B8c944e9b865A5814D656dA16544,0xcA2d7C0147fCE138736981fb1Aa273d89cC9A3BF,0x7767B19420c89Bb79908820f4a5E55dc65ca7658
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [2] : 0000000000000000000000006aa1990f72c53000aceff1d8934d1ca2802aa1d8
Arg [3] : 0000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494
Arg [4] : 000000000000000000000000d228df77af3df82cb7580d48fd0b33fe43a70f0e
Arg [5] : 000000000000000000000000cdd417d7f260b08cd10a3810321df7a40d65ba40
Arg [6] : 0000000000000000000000008a91ac199440da0b45b2e278f3fe616b1bccc494
Arg [7] : 000000000000000000000000903b15589855b8c944e9b865a5814d656da16544
Arg [8] : 000000000000000000000000ca2d7c0147fce138736981fb1aa273d89cc9a3bf
Arg [9] : 0000000000000000000000007767b19420c89bb79908820f4a5e55dc65ca7658
Swarm Source
bzzr://c83d500b45cc7d5642eb87cc3848177f96437dd6b2b73a07e1c6ad9be658cc1d
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.