contract_name
stringlengths
1
61
file_path
stringlengths
5
50.4k
contract_address
stringlengths
42
42
language
stringclasses
1 value
class_name
stringlengths
1
61
class_code
stringlengths
4
330k
class_documentation
stringlengths
0
29.1k
class_documentation_type
stringclasses
6 values
func_name
stringlengths
0
62
func_code
stringlengths
1
303k
func_documentation
stringlengths
2
14.9k
func_documentation_type
stringclasses
4 values
compiler_version
stringlengths
15
42
license_type
stringclasses
14 values
swarm_source
stringlengths
0
71
meta
dict
__index_level_0__
int64
0
60.4k
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 6899, 7242 ] }
27,300
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds ba...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 7570, 8069 ] }
27,301
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 8502, 8853 ] }
27,302
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 9451, 9548 ] }
27,303
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20Burnable
abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`...
/** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */
NatSpecMultiLine
burn
function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); }
/** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 161, 257 ] }
27,304
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
paused
function paused() public view virtual returns (bool) { return _paused; }
/** * @dev Returns true if the contract is paused, and false otherwise. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 531, 622 ] }
27,305
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
_pause
function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); }
/** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1331, 1454 ] }
27,306
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
_unpause
function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); }
/** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1590, 1715 ] }
27,307
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC20Pausable
abstract contract ERC20Pausable is ERC20, Pausable { /** * @dev See {ERC20-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._...
/** * @dev ERC20 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. */
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); require(!paused(), "ERC20Pausable: token transfer while paused"); }
/** * @dev See {ERC20-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 200, 443 ] }
27,308
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Strings
library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT lice...
/** * @dev String operations. */
NatSpecMultiLine
toString
function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 ...
/** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 180, 908 ] }
27,309
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Strings
library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT lice...
/** * @dev String operations. */
NatSpecMultiLine
toHexString
function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); }
/** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1013, 1358 ] }
27,310
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
Strings
library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT lice...
/** * @dev String operations. */
NatSpecMultiLine
toHexString
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = alphabet[value & 0xf]; value >>= 4; } ...
/** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1481, 1933 ] }
27,311
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
IERC165
interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This f...
/** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) external view returns (bool);
/** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 374, 455 ] }
27,312
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
ERC165
abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
/** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interface...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 103, 265 ] }
27,313
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1953, 2175 ] }
27,314
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
hasRole
function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; }
/** * @dev Returns `true` if `account` has been granted `role`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 2262, 2406 ] }
27,315
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_checkRole
function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role),...
/** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 2691, 3080 ] }
27,316
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
getRoleAdmin
function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; }
/** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 3264, 3392 ] }
27,317
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
grantRole
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 3649, 3801 ] }
27,318
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
revokeRole
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); }
/** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 4041, 4195 ] }
27,319
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
renounceRole
function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); }
/** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 4697, 4920 ] }
27,320
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_setupRole
function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor w...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 5498, 5615 ] }
27,321
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_setRoleAdmin
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; }
/** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 5742, 5942 ] }
27,322
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_add
function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; retur...
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 908, 1327 ] }
27,323
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_remove
function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element f...
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1498, 3056 ] }
27,324
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_contains
function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 3137, 3271 ] }
27,325
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_length
function _length(Set storage set) private view returns (uint256) { return set._values.length; }
/** * @dev Returns the number of values on the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 3352, 3466 ] }
27,326
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
_at
function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 3805, 4014 ] }
27,327
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
add
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); }
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 4263, 4393 ] }
27,328
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
remove
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); }
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 4564, 4700 ] }
27,329
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
contains
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 4781, 4926 ] }
27,330
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
length
function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); }
/** * @dev Returns the number of values in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 5007, 5129 ] }
27,331
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
at
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 5468, 5604 ] }
27,332
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
add
function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); }
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 5853, 6010 ] }
27,333
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
remove
function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); }
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 6181, 6344 ] }
27,334
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
contains
function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 6425, 6597 ] }
27,335
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
length
function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); }
/** * @dev Returns the number of values in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 6678, 6800 ] }
27,336
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
at
function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 7139, 7302 ] }
27,337
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
add
function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); }
/** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 7547, 7683 ] }
27,338
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
remove
function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); }
/** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 7854, 7996 ] }
27,339
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
contains
function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); }
/** * @dev Returns true if the value is in the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 8077, 8228 ] }
27,340
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
length
function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); }
/** * @dev Returns the number of values on the set. O(1). */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 8309, 8428 ] }
27,341
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
EnumerableSet
library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are...
/** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are ma...
NatSpecMultiLine
at
function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); }
/** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 8767, 8909 ] }
27,342
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 284, 516 ] }
27,343
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
getRoleMember
function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); }
/** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make ...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1110, 1260 ] }
27,344
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
getRoleMemberCount
function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); }
/** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1429, 1568 ] }
27,345
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
grantRole
function grantRole(bytes32 role, address account) public virtual override { super.grantRole(role, account); _roleMembers[role].add(account); }
/** * @dev Overload {grantRole} to track enumerable memberships */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1655, 1825 ] }
27,346
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
revokeRole
function revokeRole(bytes32 role, address account) public virtual override { super.revokeRole(role, account); _roleMembers[role].remove(account); }
/** * @dev Overload {revokeRole} to track enumerable memberships */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1913, 2088 ] }
27,347
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
renounceRole
function renounceRole(bytes32 role, address account) public virtual override { super.renounceRole(role, account); _roleMembers[role].remove(account); }
/** * @dev Overload {renounceRole} to track enumerable memberships */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 2178, 2357 ] }
27,348
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
AccessControlEnumerable
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping (bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes...
/** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */
NatSpecMultiLine
_setupRole
function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); }
/** * @dev Overload {_setupRole} to track enumerable memberships */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 2445, 2619 ] }
27,349
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
WORK
contract WORK is Context, AccessControlEnumerable, ERC20Burnable, ERC20Pausable { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_...
mint
function mint(address to, uint256 amount) public virtual { require( hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint" ); _mint(to, amount); }
/** * @dev Creates `amount` new tokens for `to`. * * See {ERC20-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 920, 1167 ] }
27,350
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
WORK
contract WORK is Context, AccessControlEnumerable, ERC20Burnable, ERC20Pausable { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_...
pause
function pause() public virtual { require( hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to pause" ); _pause(); }
/** * @dev Pauses all token transfers. * * See {ERC20Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1376, 1590 ] }
27,351
WORK
WORK.sol
0x1482295df16e7761d128b9823b61785d43ca038b
Solidity
WORK
contract WORK is Context, AccessControlEnumerable, ERC20Burnable, ERC20Pausable { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_...
unpause
function unpause() public virtual { require( hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause" ); _unpause(); }
/** * @dev Unpauses all token transfers. * * See {ERC20Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://cbf15b3fd15aeb430ff60c90f734fe32c80599508732d709b463b8e49b1f598b
{ "func_code_index": [ 1803, 2023 ] }
27,352
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
SafeMath
library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function add32(uint32 a, uint32 b) internal pure returns (uint32) { uint32 c = a + b; r...
sqrrt
function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } }
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
LineComment
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 1850, 2188 ] }
27,353
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
distribute
function distribute() external returns ( bool ) { if ( nextEpochTime <= uint32(block.timestamp) ) { nextEpochTime = nextEpochTime.add32( epochLength ); // set next epoch time // distribute rewards to each recipient for ( uint i = 0; i < info.length; i++ ) { if ...
/** @notice send epoch reward to staking contract */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 1209, 1976 ] }
27,354
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
adjust
function adjust( uint _index ) internal { Adjust memory adjustment = adjustments[ _index ]; if ( adjustment.rate != 0 ) { if ( adjustment.add ) { // if rate should increase info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate if ( info[ _index ].ra...
/** @notice increment reward rate for collector */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 2112, 2954 ] }
27,355
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
nextRewardAt
function nextRewardAt( uint _rate ) public view returns ( uint ) { return IERC20( OHM ).totalSupply().mul( _rate ).div( 1000000 ); }
/** @notice view function for next reward at given rate @param _rate uint @return uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 3143, 3294 ] }
27,356
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
nextRewardFor
function nextRewardFor( address _recipient ) public view returns ( uint ) { uint reward; for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].recipient == _recipient ) { reward = nextRewardAt( info[ i ].rate ); } } return reward; }
/** @notice view function for next reward for specified address @param _recipient address @return uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 3441, 3766 ] }
27,357
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
addRecipient
function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() { require( _recipient != address(0) ); info.push( Info({ recipient: _recipient, rate: _rewardRate })); }
/** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 3965, 4216 ] }
27,358
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
removeRecipient
function removeRecipient( uint _index, address _recipient ) external onlyPolicy() { require( _recipient == info[ _index ].recipient ); info[ _index ].recipient = address(0); info[ _index ].rate = 0; }
/** @notice removes recipient for distributions @param _index uint @param _recipient address */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 4353, 4590 ] }
27,359
Distributor
Distributor.sol
0x9b55666b7e068a67576d72824f3ac1563ef5fd3a
Solidity
Distributor
contract Distributor is Policy { using SafeMath for uint; using SafeMath for uint32; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint32 public immutable epochLength; uint32 pu...
setAdjustment
function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() { adjustments[ _index ] = Adjust({ add: _add, rate: _rate, target: _target }); }
/** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */
NatSpecMultiLine
v0.7.5+commit.eb77ed08
Unknown
ipfs://71482b50f1072d3504a82fc122e0dbd19848bdfe86d3664ca9cc0d31d3d8a451
{ "func_code_index": [ 4788, 5032 ] }
27,360
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
EtherPaymentFallback
contract EtherPaymentFallback { /// @dev Fallback function accepts Ether transactions. function () external payable { } }
function () external payable { }
/// @dev Fallback function accepts Ether transactions.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 95, 162 ] }
27,361
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SecuredTokenTransfer
contract SecuredTokenTransfer { /// @dev Transfers a token and returns if it was a success /// @param token Token that should be transferred /// @param receiver Receiver to whom the token should be transferred /// @param amount The amount of tokens that should be transferred function transfer...
transferToken
function transferToken ( address token, address receiver, uint256 amount ) internal returns (bool transferred) { bytes memory data = abi.encodeWithSignature("transfer(address,uint256)", receiver, amount); // solium-disable-next-line security/no-inline-assembly assembly { ...
/// @dev Transfers a token and returns if it was a success /// @param token Token that should be transferred /// @param receiver Receiver to whom the token should be transferred /// @param amount The amount of tokens that should be transferred
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 299, 1075 ] }
27,362
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
ModuleManager
contract ModuleManager is SelfAuthorized, Executor { event EnabledModule(Module module); event DisabledModule(Module module); address public constant SENTINEL_MODULES = address(0x1); mapping (address => address) internal modules; function setupModules(address to, bytes memory data) ...
enableModule
function enableModule(Module module) public authorized { // Module address cannot be null or sentinel. require(address(module) != address(0) && address(module) != SENTINEL_MODULES, "Invalid module address provided"); // Module cannot be added twice. require(modules[address(module)] == add...
/// @dev Allows to add a module to the whitelist. /// This can only be done via a Safe transaction. /// @param module Module to be whitelisted.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 877, 1433 ] }
27,363
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
ModuleManager
contract ModuleManager is SelfAuthorized, Executor { event EnabledModule(Module module); event DisabledModule(Module module); address public constant SENTINEL_MODULES = address(0x1); mapping (address => address) internal modules; function setupModules(address to, bytes memory data) ...
disableModule
function disableModule(Module prevModule, Module module) public authorized { // Validate module address and check that it corresponds to module index. require(address(module) != address(0) && address(module) != SENTINEL_MODULES, "Invalid module address provided"); require(modules[address(prevM...
/// @dev Allows to remove a module from the whitelist. /// This can only be done via a Safe transaction. /// @param prevModule Module that pointed to the module to be removed in the linked list /// @param module Module to be removed.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 1695, 2275 ] }
27,364
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
ModuleManager
contract ModuleManager is SelfAuthorized, Executor { event EnabledModule(Module module); event DisabledModule(Module module); address public constant SENTINEL_MODULES = address(0x1); mapping (address => address) internal modules; function setupModules(address to, bytes memory data) ...
execTransactionFromModule
function execTransactionFromModule(address to, uint256 value, bytes memory data, Enum.Operation operation) public returns (bool success) { // Only whitelisted modules are allowed. require(modules[msg.sender] != address(0), "Method can only be called from an enabled module"); // Execute transac...
/// @dev Allows a Module to execute a Safe transaction without any further confirmations. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 2613, 3071 ] }
27,365
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
ModuleManager
contract ModuleManager is SelfAuthorized, Executor { event EnabledModule(Module module); event DisabledModule(Module module); address public constant SENTINEL_MODULES = address(0x1); mapping (address => address) internal modules; function setupModules(address to, bytes memory data) ...
getModules
function getModules() public view returns (address[] memory) { // Calculate module count uint256 moduleCount = 0; address currentModule = modules[SENTINEL_MODULES]; while(currentModule != SENTINEL_MODULES) { currentModule = modules[currentModule]; moduleCount ++; ...
/// @dev Returns array of modules. /// @return Array of modules.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 3149, 3922 ] }
27,366
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
setupOwners
function setupOwners(address[] memory _owners, uint256 _threshold) internal { // Threshold can only be 0 at initialization. // Check ensures that setup function can only be called once. require(threshold == 0, "Owners have already been setup"); // Validate that threshold is smaller than number...
/// @dev Setup function sets initial storage of contract. /// @param _owners List of Safe owners. /// @param _threshold Number of required confirmations for a Safe transaction.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 538, 1802 ] }
27,367
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
addOwnerWithThreshold
function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized { // Owner address cannot be null. require(owner != address(0) && owner != SENTINEL_OWNERS, "Invalid owner address provided"); // No duplicate owners allowed. require(owners[owner] == address(0), "Address ...
/// @dev Allows to add a new owner to the Safe and update the threshold at the same time. /// This can only be done via a Safe transaction. /// @param owner New owner address. /// @param _threshold New threshold.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 2043, 2708 ] }
27,368
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
removeOwner
function removeOwner(address prevOwner, address owner, uint256 _threshold) public authorized { // Only allow to remove an owner, if threshold can still be reached. require(ownerCount - 1 >= _threshold, "New owner count needs to be larger than new threshold"); // Validate owner address and chec...
/// @dev Allows to remove an owner from the Safe and update the threshold at the same time. /// This can only be done via a Safe transaction. /// @param prevOwner Owner that pointed to the owner to be removed in the linked list /// @param owner Owner address to be removed. /// @param _threshold New threshold.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 3052, 3908 ] }
27,369
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
swapOwner
function swapOwner(address prevOwner, address oldOwner, address newOwner) public authorized { // Owner address cannot be null. require(newOwner != address(0) && newOwner != SENTINEL_OWNERS, "Invalid owner address provided"); // No duplicate owners allowed. require(owners[newOwner] == addr...
/// @dev Allows to swap/replace an owner from the Safe with another address. /// This can only be done via a Safe transaction. /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list /// @param oldOwner Owner address to be replaced. /// @param newOwner New owner address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 4244, 5124 ] }
27,370
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
changeThreshold
function changeThreshold(uint256 _threshold) public authorized { // Validate that threshold is smaller than number of owners. require(_threshold <= ownerCount, "Threshold cannot exceed owner count"); // There has to be at least one Safe owner. require(_threshold >= 1, "Threshold needs to ...
/// @dev Allows to update the number of required confirmations by Safe owners. /// This can only be done via a Safe transaction. /// @param _threshold New threshold.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 5313, 5769 ] }
27,371
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
OwnerManager
contract OwnerManager is SelfAuthorized { event AddedOwner(address owner); event RemovedOwner(address owner); event ChangedThreshold(uint256 threshold); address public constant SENTINEL_OWNERS = address(0x1); mapping(address => address) internal owners; uint256 ownerCount; uint2...
getOwners
function getOwners() public view returns (address[] memory) { address[] memory array = new address[](ownerCount); // populate return array uint256 index = 0; address currentOwner = owners[SENTINEL_OWNERS]; while(currentOwner != SENTINEL_OWNERS) { array[index] = curren...
/// @dev Returns array of owners. /// @return Array of Safe owners.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 6131, 6617 ] }
27,372
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
BaseSafe
contract BaseSafe is ModuleManager, OwnerManager { /// @dev Setup function sets initial storage of contract. /// @param _owners List of Safe owners. /// @param _threshold Number of required confirmations for a Safe transaction. /// @param to Contract address for optional delegate call. /// @p...
setupSafe
function setupSafe(address[] memory _owners, uint256 _threshold, address to, bytes memory data) internal { setupOwners(_owners, _threshold); // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules setupModules(to, data); }
/// @dev Setup function sets initial storage of contract. /// @param _owners List of Safe owners. /// @param _threshold Number of required confirmations for a Safe transaction. /// @param to Contract address for optional delegate call. /// @param data Data payload for optional delegate call.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 372, 706 ] }
27,373
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
MasterCopy
contract MasterCopy is SelfAuthorized { // masterCopy always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract. // It should also always be ensured that the address is stored alone (uses a full word) address masterCopy; /// @dev Allows to upgrade the...
changeMasterCopy
function changeMasterCopy(address _masterCopy) public authorized { // Master copy address cannot be null. require(_masterCopy != address(0), "Invalid master copy address provided"); masterCopy = _masterCopy; }
/// @dev Allows to upgrade the contract. This can only be done via a Safe transaction. /// @param _masterCopy New contract address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 426, 695 ] }
27,374
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SignatureDecoder
contract SignatureDecoder { /// @dev Recovers address who signed the message /// @param messageHash operation ethereum signed message hash /// @param messageSignature message `txHash` signature /// @param pos which signature to read function recoverKey ( bytes32 messageHash, ...
recoverKey
function recoverKey ( bytes32 messageHash, bytes memory messageSignature, uint256 pos ) internal pure returns (address) { uint8 v; bytes32 r; bytes32 s; (v, r, s) = signatureSplit(messageSignature, pos); return ecrecover(messageHash, v, r, s); }
/// @dev Recovers address who signed the message /// @param messageHash operation ethereum signed message hash /// @param messageSignature message `txHash` signature /// @param pos which signature to read
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 261, 627 ] }
27,375
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SignatureDecoder
contract SignatureDecoder { /// @dev Recovers address who signed the message /// @param messageHash operation ethereum signed message hash /// @param messageSignature message `txHash` signature /// @param pos which signature to read function recoverKey ( bytes32 messageHash, ...
signatureSplit
function signatureSplit(bytes memory signatures, uint256 pos) internal pure returns (uint8 v, bytes32 r, bytes32 s) { // The signature format is a compact form of: // {bytes32 r}{bytes32 s}{uint8 v} // Compact means, uint8 is not padded to 32 bytes. // solium-disable-next-line secu...
/// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s` /// @param pos which signature to read /// @param signatures concatenated rsv signatures
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 804, 1750 ] }
27,376
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256...
/** * @dev Multiplies two numbers, reverts on overflow. */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 90, 486 ] }
27,377
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 598, 877 ] }
27,378
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 992, 1131 ] }
27,379
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two numbers, reverts on overflow. */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 1196, 1335 ] }
27,380
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 1470, 1587 ] }
27,381
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
ISignatureValidator
contract ISignatureValidator { /** * @dev Should return whether the signature provided is valid for the provided data * @param _data Arbitrary length data signed on the behalf of address(this) * @param _signature Signature byte array associated with _data * * MUST return a bool upon valid ...
isValidSignature
function isValidSignature( bytes calldata _data, bytes calldata _signature) external returns (bool isValid) {}
/** * @dev Should return whether the signature provided is valid for the provided data * @param _data Arbitrary length data signed on the behalf of address(this) * @param _signature Signature byte array associated with _data * * MUST return a bool upon valid or invalid signature with corresponding _data * M...
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 421, 573 ] }
27,382
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
setup
function setup(address[] calldata _owners, uint256 _threshold, address to, bytes calldata data) external { require(domainSeparator == 0, "Domain Separator already set!"); domainSeparator = keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, this)); setupSafe(_owners, _threshold, to, data); }
/// @dev Setup function sets initial storage of contract. /// @param _owners List of Safe owners. /// @param _threshold Number of required confirmations for a Safe transaction. /// @param to Contract address for optional delegate call. /// @param data Data payload for optional delegate call.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 1729, 2068 ] }
27,383
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
execTransaction
function execTransaction( address to, uint256 value, bytes calldata data, Enum.Operation operation, uint256 safeTxGas, uint256 dataGas, uint256 gasPrice, address gasToken, address payable refundReceiver, bytes calldata signatures ) external returns (bool succ...
/// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction. /// Note: The fees are always transfered, even if the user transaction fails. /// @param to Destination address of Safe transaction. /// @param value Ether value of Safe tr...
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 3064, 4582 ] }
27,384
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
checkSignatures
function checkSignatures(bytes32 dataHash, bytes memory data, bytes memory signatures, bool consumeHash) internal returns (bool) { // Check that the provided signature data is not too short if (signatures.length < threshold * 65) { return false; } // There cannot be an owner with...
/** * @dev Should return whether the signature provided is valid for the provided data, hash * @param dataHash Hash of the data (could be either a message hash or transaction hash) * @param data That should be signed (this is passed to an external validator contract) * @param signatures Signature data that shou...
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 5963, 8522 ] }
27,385
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
requiredTxGas
function requiredTxGas(address to, uint256 value, bytes calldata data, Enum.Operation operation) external authorized returns (uint256) { uint256 startGas = gasleft(); // We don't provide an error message here, as we use it to return the estimate // solium-disable-next-line error-reason ...
/// @dev Allows to estimate a Safe transaction. /// This method is only meant for estimation purpose, therfore two different protection mechanism against execution in a transaction have been made: /// 1.) The method can only be called from the safe itself /// 2.) The response is returned with a revert //...
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 9441, 10041 ] }
27,386
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
approveHash
function approveHash(bytes32 hashToApprove) external { require(owners[msg.sender] != address(0), "Only owners can approve a hash"); approvedHashes[msg.sender][hashToApprove] = 1; }
/** * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature. * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract. */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 10286, 10508 ] }
27,387
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
signMessage
function signMessage(bytes calldata _data) external authorized { signedMessages[getMessageHash(_data)] = 1; }
/** * @dev Marks a message as signed * @param _data Arbitrary length data that should be marked as signed on the behalf of address(this) */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 10672, 10824 ] }
27,388
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
isValidSignature
function isValidSignature(bytes calldata _data, bytes calldata _signature) external returns (bool isValid) { bytes32 messageHash = getMessageHash(_data); if (_signature.length == 0) { isValid = signedMessages[messageHash] != 0; } else { // consumeHash needs to be false, as th...
/** * @dev Should return whether the signature provided is valid for the provided data * @param _data Arbitrary length data signed on the behalf of address(this) * @param _signature Signature byte array associated with _data * @return a bool upon valid or invalid signature with corresponding _data */
NatSpecMultiLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 11160, 11643 ] }
27,389
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
getMessageHash
function getMessageHash( bytes memory message ) public view returns (bytes32) { bytes32 safeMessageHash = keccak256( abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)) ); return keccak256( abi.encodePacked(byte(0x19), byte(0x01), domainSeparator, safeMessageHash) ...
/// @dev Returns hash of a message that can be signed by owners. /// @param message Message that should be hashed /// @return Message hash.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 11801, 12186 ] }
27,390
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
encodeTransactionData
function encodeTransactionData( address to, uint256 value, bytes memory data, Enum.Operation operation, uint256 safeTxGas, uint256 dataGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce ) public view returns (bytes memo...
/// @dev Returns the bytes that are hashed to be signed by owners. /// @param to Destination address. /// @param value Ether value. /// @param data Data payload. /// @param operation Operation type. /// @param safeTxGas Fas that should be used for the safe transaction. /// @param dataGas Gas costs for data used to trig...
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 12908, 13591 ] }
27,391
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
GnosisSafe
contract GnosisSafe is MasterCopy, BaseSafe, SignatureDecoder, SecuredTokenTransfer, ISignatureValidator { using SafeMath for uint256; string public constant NAME = "Gnosis Safe"; string public constant VERSION = "0.1.0"; //keccak256( // "EIP712Domain(address verifyingContract)" /...
getTransactionHash
function getTransactionHash( address to, uint256 value, bytes memory data, Enum.Operation operation, uint256 safeTxGas, uint256 dataGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 _nonce ) public view returns (bytes32) { ...
/// @dev Returns hash to be signed by owners. /// @param to Destination address. /// @param value Ether value. /// @param data Data payload. /// @param operation Operation type. /// @param safeTxGas Fas that should be used for the safe transaction. /// @param dataGas Gas costs for data used to trigger the safe transact...
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 14286, 14818 ] }
27,392
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
setup
function setup(address dx, address[] memory tokens, address[] memory operators, address payable _manager) public { require(address(manager) == address(0), "Manager has already been set"); if (_manager == address(0)){ manager = ModuleManager(msg.sender); } else{ manager = Modu...
/// @dev Setup function sets initial storage of contract. /// @param dx DutchX Proxy Address. /// @param tokens List of whitelisted tokens. /// @param operators List of addresses that can operate the module. /// @param _manager Address of the manager, the safe contract.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 683, 1659 ] }
27,393
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
addToWhitelist
function addToWhitelist(address token) public authorized { require(token != address(0), "Invalid token provided"); require(!isWhitelistedToken[token], "Token is already whitelisted"); isWhitelistedToken[token] = true; whitelistedTokens.push(token); }
/// @dev Allows to add token to whitelist. This can only be done via a Safe transaction. /// @param token ERC20 token address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 1799, 2118 ] }
27,394
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
removeFromWhitelist
function removeFromWhitelist(address token) public authorized { require(isWhitelistedToken[token], "Token is not whitelisted"); isWhitelistedToken[token] = false; for (uint i = 0; i<whitelistedTokens.length - 1; i++) if(whitelistedTokens[i] == token){ whitelistedTokens[...
/// @dev Allows to remove token from whitelist. This can only be done via a Safe transaction. /// @param token ERC20 token address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 2263, 2757 ] }
27,395
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
addOperator
function addOperator(address operator) public authorized { require(operator != address(0), "Invalid address provided"); require(!isOperator[operator], "Operator is already whitelisted"); isOperator[operator] = true; whitelistedOperators.push(operator); }
/// @dev Allows to add operator to whitelist. This can only be done via a Safe transaction. /// @param operator ethereum address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 2900, 3223 ] }
27,396
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
removeOperator
function removeOperator(address operator) public authorized { require(isOperator[operator], "Operator is not whitelisted"); isOperator[operator] = false; for (uint i = 0; i<whitelistedOperators.length - 1; i++) if(whitelistedOperators[i] == operator){ whitelistedOperato...
/// @dev Allows to remove operator from whitelist. This can only be done via a Safe transaction. /// @param operator ethereum address.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 3371, 3879 ] }
27,397
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
changeDXProxy
function changeDXProxy(address dx) public authorized { require(dx != address(0), "Invalid address provided"); dutchXAddress = dx; }
/// @dev Allows to change DutchX Proxy contract address. This can only be done via a Safe transaction. /// @param dx New proxy contract address for DutchX.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 4048, 4230 ] }
27,398
DutchXCompleteModule
DutchXCompleteModule.sol
0xba22d73c079ceb97db93f2effb1f1054fe1cfcd6
Solidity
DutchXBaseModule
contract DutchXBaseModule is Module { address public dutchXAddress; // isWhitelistedToken mapping maps destination address to boolean. mapping (address => bool) public isWhitelistedToken; mapping (address => bool) public isOperator; // helper variables used by the CLI address[] public ...
/// @title DutchX Base Module - Expose a set of methods to enable a Safe to interact with a DX /// @author Denis Granha - <denis@gnosis.pm>
NatSpecSingleLine
executeWhitelisted
function executeWhitelisted(address to, uint256 value, bytes memory data) public returns (bool);
/// @dev Abstract method. Returns if Safe transaction is to DutchX contract and with whitelisted tokens. /// @param to Dutch X address or Whitelisted token (only for approve operations for DX). /// @param value Not checked. /// @param data Allowed operations /// @return Returns if transaction can be executed.
NatSpecSingleLine
v0.5.3+commit.10d17f24
bzzr://f29a408228e1590839e2da6bf7b5d1256db2c2d8345ec16af1e6ec73b6d1edb4
{ "func_code_index": [ 4569, 4688 ] }
27,399