contract_name
stringlengths
1
100
contract_address
stringlengths
42
42
language
stringclasses
2 values
source_code
stringlengths
0
1.24M
solidetector
stringlengths
2
3.89k
slither
stringlengths
2
4.49M
oyente
stringlengths
2
10.8k
smartcheck
stringlengths
2
78.6k
abi
stringlengths
2
59.6k
compiler_version
stringlengths
11
42
optimization_used
bool
2 classes
runs
int64
0
1B
constructor_arguments
stringlengths
0
60.2k
evm_version
stringclasses
8 values
library
stringlengths
0
510
license_type
stringclasses
14 values
proxy
bool
2 classes
implementation
stringlengths
0
42
swarm_source
stringlengths
0
71
UserWallet
0x84dabbb8999f508ce1cbb7057d260c74c6c9815c
Solidity
pragma solidity ^0.4.10; // Copyright 2017 Bittrex contract AbstractSweeper { function sweep(address token, uint amount) returns (bool); function () { throw; } Controller controller; function AbstractSweeper(address _controller) { controller = Controller(_controller); } modifier canSweep() { if (msg.sender != controller.authorizedCaller() && msg.sender != controller.owner()) throw; if (controller.halted()) throw; _; } } contract Token { function balanceOf(address a) returns (uint) { (a); return 0; } function transfer(address a, uint val) returns (bool) { (a); (val); return false; } } contract DefaultSweeper is AbstractSweeper { function DefaultSweeper(address controller) AbstractSweeper(controller) {} function sweep(address _token, uint _amount) canSweep returns (bool) { bool success = false; address destination = controller.destination(); if (_token != address(0)) { Token token = Token(_token); uint amount = _amount; if (amount > token.balanceOf(this)) { return false; } success = token.transfer(destination, amount); } else { uint amountInWei = _amount; if (amountInWei > this.balance) { return false; } success = destination.send(amountInWei); } if (success) { controller.logSweep(this, destination, _token, _amount); } return success; } } contract UserWallet { AbstractSweeperList sweeperList; function UserWallet(address _sweeperlist) { sweeperList = AbstractSweeperList(_sweeperlist); } function () public payable { } function tokenFallback(address _from, uint _value, bytes _data) { (_from); (_value); (_data); } function sweep(address _token, uint _amount) returns (bool) { (_amount); return sweeperList.sweeperOf(_token).delegatecall(msg.data); } } contract AbstractSweeperList { function sweeperOf(address _token) returns (address); } contract Controller is AbstractSweeperList { address public owner; address public authorizedCaller; address public destination; bool public halted; event LogNewWallet(address receiver); event LogSweep(address indexed from, address indexed to, address indexed token, uint amount); modifier onlyOwner() { if (msg.sender != owner) throw; _; } modifier onlyAuthorizedCaller() { if (msg.sender != authorizedCaller) throw; _; } modifier onlyAdmins() { if (msg.sender != authorizedCaller && msg.sender != owner) throw; _; } function Controller() { owner = msg.sender; destination = msg.sender; authorizedCaller = msg.sender; } function changeAuthorizedCaller(address _newCaller) onlyOwner { authorizedCaller = _newCaller; } function changeDestination(address _dest) onlyOwner { destination = _dest; } function changeOwner(address _owner) onlyOwner { owner = _owner; } function makeWallet() onlyAdmins returns (address wallet) { wallet = address(new UserWallet(this)); LogNewWallet(wallet); } function halt() onlyAdmins { halted = true; } function start() onlyOwner { halted = false; } address public defaultSweeper = address(new DefaultSweeper(this)); mapping (address => address) sweepers; function addSweeper(address _token, address _sweeper) onlyOwner { sweepers[_token] = _sweeper; } function sweeperOf(address _token) returns (address) { address sweeper = sweepers[_token]; if (sweeper == 0) sweeper = defaultSweeper; return sweeper; } function logSweep(address from, address to, address token, uint amount) { LogSweep(from, to, token, amount); } }
[{"defect": "Unchecked_send", "type": "Function_call", "severity": "High", "lines": ["88"]}, {"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["71"]}, {"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["23"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["122", "37"]}]
[{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium", "lines": {"UserWallet.sol": [88]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [118]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [108]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [18]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [113]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [8]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [17]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [79, 80, 81, 82, 83]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [144, 141, 142, 143]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [146, 147, 148]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [137, 138, 139]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [77]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [8]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [129, 130, 131]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [133, 134, 135]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [85, 86, 87, 88, 89]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [32, 33, 29, 30, 31]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [24, 25, 26, 27]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [168, 169, 167]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [161, 162, 163, 164, 165]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [152, 150, 151]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"UserWallet.sol": [157, 158, 159]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [1]}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"UserWallet.sol": [10]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [88]}}, {"check": "events-access", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [138]}}, {"check": "events-access", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [130]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [134]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [138]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [130]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"UserWallet.sol": [88]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [157]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [85]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [137]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [133]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [129]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [157]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [40]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [40]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"UserWallet.sol": [161]}}]
[{"error": "Callstack Depth Attack Vulnerability.", "line": 61, "level": "Warning"}, {"error": "Integer Overflow.", "line": 79, "level": "Warning"}]
[{"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 8, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 17, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 18, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 108, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 113, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 118, "severity": 1}, {"rule": "SOLIDITY_ERC20_TRANSFER_SHOULD_THROW", "line": 29, "severity": 1}, {"rule": "SOLIDITY_LOCKED_MONEY", "line": 71, "severity": 3}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 1, "severity": 1}, {"rule": "SOLIDITY_REDUNDANT_FALLBACK_REJECT", "line": 8, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 17, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 18, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 108, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 113, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 118, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 77, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 6, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 8, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 12, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 24, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 29, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 37, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 40, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 73, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 79, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 85, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 93, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 122, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 129, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 133, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 137, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 141, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 146, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 150, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 157, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 161, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 167, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 10, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 72, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 155, "severity": 1}]
[{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_amount","type":"uint256"}],"name":"sweep","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"tokenFallback","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_sweeperlist","type":"address"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"}]
v0.4.11+commit.68ef5810
true
200
000000000000000000000000a3C1E324CA1ce40db73eD6026c4A177F099B5770
Default
false
bzzr://4cdd69fdcf3cf6cbee9677fe380fa5f044048aa9e060ec5619a21ca5a5bd4cd1
Forwarder
0x17be21ab0d0a5255d5cd4ce387f42d95b81f88ea
Solidity
pragma solidity ^0.4.14; /** * Contract that exposes the needed erc20 token functions */ contract ERC20Interface { // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) returns (bool success); // Get the account balance of another account with address _owner function balanceOf(address _owner) constant returns (uint256 balance); } /** * Contract that will forward any incoming Ether to its creator */ contract Forwarder { // Address to which any funds sent to this contract will be forwarded address public parentAddress; event ForwarderDeposited(address from, uint value, bytes data); event TokensFlushed( address tokenContractAddress, // The contract address of the token uint value // Amount of token sent ); /** * Create the contract, and set the destination address to that of the creator */ function Forwarder() { parentAddress = msg.sender; } /** * Modifier that will execute internal code block only if the sender is a parent of the forwarder contract */ modifier onlyParent { if (msg.sender != parentAddress) { throw; } _; } /** * Default function; Gets called when Ether is deposited, and forwards it to the destination address */ function() payable { if (!parentAddress.call.value(msg.value)(msg.data)) throw; // Fire off the deposited event if we can forward it ForwarderDeposited(msg.sender, msg.value, msg.data); } /** * Execute a token transfer of the full balance from the forwarder token to the main wallet contract * @param tokenContractAddress the address of the erc20 token contract */ function flushTokens(address tokenContractAddress) onlyParent { ERC20Interface instance = ERC20Interface(tokenContractAddress); var forwarderAddress = address(this); var forwarderBalance = instance.balanceOf(forwarderAddress); if (forwarderBalance == 0) { return; } if (!instance.transfer(parentAddress, forwarderBalance)) { throw; } TokensFlushed(tokenContractAddress, forwarderBalance); } /** * It is possible that funds were sent to this address before the contract was deployed. * We can flush those funds to the destination address. */ function flush() { if (!parentAddress.call.value(this.balance)()) throw; } } /** * Basic multi-signer wallet designed for use in a co-signing environment where 2 signatures are required to move funds. * Typically used in a 2-of-3 signing configuration. Uses ecrecover to allow for 2 signatures in a single transaction. */ contract WalletSimple { // Events event Deposited(address from, uint value, bytes data); event SafeModeActivated(address msgSender); event Transacted( address msgSender, // Address of the sender of the message initiating the transaction address otherSigner, // Address of the signer (second signature) used to initiate the transaction bytes32 operation, // Operation hash (sha3 of toAddress, value, data, expireTime, sequenceId) address toAddress, // The address the transaction was sent to uint value, // Amount of Wei sent to the address bytes data // Data sent when invoking the transaction ); event TokenTransacted( address msgSender, // Address of the sender of the message initiating the transaction address otherSigner, // Address of the signer (second signature) used to initiate the transaction bytes32 operation, // Operation hash (sha3 of toAddress, value, tokenContractAddress, expireTime, sequenceId) address toAddress, // The address the transaction was sent to uint value, // Amount of token sent address tokenContractAddress // The contract address of the token ); // Public fields address[] public signers; // The addresses that can co-sign transactions on the wallet bool public safeMode = false; // When active, wallet may only send to signer addresses // Internal fields uint constant SEQUENCE_ID_WINDOW_SIZE = 10; uint[10] recentSequenceIds; /** * Modifier that will execute internal code block only if the sender is an authorized signer on this wallet */ modifier onlysigner { if (!isSigner(msg.sender)) { throw; } _; } /** * Set up a simple multi-sig wallet by specifying the signers allowed to be used on this wallet. * 2 signers will be required to send a transaction from this wallet. * Note: The sender is NOT automatically added to the list of signers. * Signers CANNOT be changed once they are set * * @param allowedSigners An array of signers on the wallet */ function WalletSimple(address[] allowedSigners) { if (allowedSigners.length != 3) { // Invalid number of signers throw; } signers = allowedSigners; } /** * Gets called when a transaction is received without calling a method */ function() payable { if (msg.value > 0) { // Fire deposited event if we are receiving funds Deposited(msg.sender, msg.value, msg.data); } } /** * Create a new contract (and also address) that forwards funds to this contract * returns address of newly created forwarder address */ function createForwarder() onlysigner returns (address) { return new Forwarder(); } /** * Execute a multi-signature transaction from this wallet using 2 signers: one from msg.sender and the other from ecrecover. * The signature is a signed form (using eth.sign) of tightly packed toAddress, value, data, expireTime and sequenceId * Sequence IDs are numbers starting from 1. They are used to prevent replay attacks and may not be repeated. * * @param toAddress the destination address to send an outgoing transaction * @param value the amount in Wei to be sent * @param data the data to send to the toAddress when invoking the transaction * @param expireTime the number of seconds since 1970 for which this transaction is valid * @param sequenceId the unique sequence id obtainable from getNextSequenceId * @param signature the result of eth.sign on the operationHash sha3(toAddress, value, data, expireTime, sequenceId) */ function sendMultiSig(address toAddress, uint value, bytes data, uint expireTime, uint sequenceId, bytes signature) onlysigner { // Verify the other signer var operationHash = sha3("ETHER", toAddress, value, data, expireTime, sequenceId); var otherSigner = verifyMultiSig(toAddress, operationHash, signature, expireTime, sequenceId); // Success, send the transaction if (!(toAddress.call.value(value)(data))) { // Failed executing transaction throw; } Transacted(msg.sender, otherSigner, operationHash, toAddress, value, data); } /** * Execute a multi-signature token transfer from this wallet using 2 signers: one from msg.sender and the other from ecrecover. * The signature is a signed form (using eth.sign) of tightly packed toAddress, value, tokenContractAddress, expireTime and sequenceId * Sequence IDs are numbers starting from 1. They are used to prevent replay attacks and may not be repeated. * * @param toAddress the destination address to send an outgoing transaction * @param value the amount in tokens to be sent * @param tokenContractAddress the address of the erc20 token contract * @param expireTime the number of seconds since 1970 for which this transaction is valid * @param sequenceId the unique sequence id obtainable from getNextSequenceId * @param signature the result of eth.sign on the operationHash sha3(toAddress, value, tokenContractAddress, expireTime, sequenceId) */ function sendMultiSigToken(address toAddress, uint value, address tokenContractAddress, uint expireTime, uint sequenceId, bytes signature) onlysigner { // Verify the other signer var operationHash = sha3("ERC20", toAddress, value, tokenContractAddress, expireTime, sequenceId); var otherSigner = verifyMultiSig(toAddress, operationHash, signature, expireTime, sequenceId); ERC20Interface instance = ERC20Interface(tokenContractAddress); if (!instance.transfer(toAddress, value)) { throw; } TokenTransacted(msg.sender, otherSigner, operationHash, toAddress, value, tokenContractAddress); } /** * Execute a token flush from one of the forwarder addresses. This transfer needs only a single signature and can be done by any signer * * @param forwarderAddress the address of the forwarder address to flush the tokens from * @param tokenContractAddress the address of the erc20 token contract */ function flushForwarderTokens(address forwarderAddress, address tokenContractAddress) onlysigner { Forwarder forwarder = Forwarder(forwarderAddress); forwarder.flushTokens(tokenContractAddress); } /** * Do common multisig verification for both eth sends and erc20token transfers * * @param toAddress the destination address to send an outgoing transaction * @param operationHash the sha3 of the toAddress, value, data/tokenContractAddress and expireTime * @param signature the tightly packed signature of r, s, and v as an array of 65 bytes (returned by eth.sign) * @param expireTime the number of seconds since 1970 for which this transaction is valid * @param sequenceId the unique sequence id obtainable from getNextSequenceId * returns address of the address to send tokens or eth to */ function verifyMultiSig(address toAddress, bytes32 operationHash, bytes signature, uint expireTime, uint sequenceId) private returns (address) { var otherSigner = recoverAddressFromSignature(operationHash, signature); // Verify if we are in safe mode. In safe mode, the wallet can only send to signers if (safeMode && !isSigner(toAddress)) { // We are in safe mode and the toAddress is not a signer. Disallow! throw; } // Verify that the transaction has not expired if (expireTime < block.timestamp) { // Transaction expired throw; } // Try to insert the sequence ID. Will throw if the sequence id was invalid tryInsertSequenceId(sequenceId); if (!isSigner(otherSigner)) { // Other signer not on this wallet or operation does not match arguments throw; } if (otherSigner == msg.sender) { // Cannot approve own transaction throw; } return otherSigner; } /** * Irrevocably puts contract into safe mode. When in this mode, transactions may only be sent to signing addresses. */ function activateSafeMode() onlysigner { safeMode = true; SafeModeActivated(msg.sender); } /** * Determine if an address is a signer on this wallet * @param signer address to check * returns boolean indicating whether address is signer or not */ function isSigner(address signer) returns (bool) { // Iterate through all signers on the wallet and for (uint i = 0; i < signers.length; i++) { if (signers[i] == signer) { return true; } } return false; } /** * Gets the second signer's address using ecrecover * @param operationHash the sha3 of the toAddress, value, data/tokenContractAddress and expireTime * @param signature the tightly packed signature of r, s, and v as an array of 65 bytes (returned by eth.sign) * returns address recovered from the signature */ function recoverAddressFromSignature(bytes32 operationHash, bytes signature) private returns (address) { if (signature.length != 65) { throw; } // We need to unpack the signature, which is given as an array of 65 bytes (from eth.sign) bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(signature, 32)) s := mload(add(signature, 64)) v := and(mload(add(signature, 65)), 255) } if (v < 27) { v += 27; // Ethereum versions are 27 or 28 as opposed to 0 or 1 which is submitted by some signing libs } return ecrecover(operationHash, v, r, s); } /** * Verify that the sequence id has not been used before and inserts it. Throws if the sequence ID was not accepted. * We collect a window of up to 10 recent sequence ids, and allow any sequence id that is not in the window and * greater than the minimum element in the window. * @param sequenceId to insert into array of stored ids */ function tryInsertSequenceId(uint sequenceId) onlysigner private { // Keep a pointer to the lowest value element in the window uint lowestValueIndex = 0; for (uint i = 0; i < SEQUENCE_ID_WINDOW_SIZE; i++) { if (recentSequenceIds[i] == sequenceId) { // This sequence ID has been used before. Disallow! throw; } if (recentSequenceIds[i] < recentSequenceIds[lowestValueIndex]) { lowestValueIndex = i; } } if (sequenceId < recentSequenceIds[lowestValueIndex]) { // The sequence ID being used is lower than the lowest value in the window // so we cannot accept it as it may have been used before throw; } if (sequenceId > (recentSequenceIds[lowestValueIndex] + 10000)) { // Block sequence IDs which are much higher than the lowest value // This prevents people blocking the contract by using very large sequence IDs quickly throw; } recentSequenceIds[lowestValueIndex] = sequenceId; } /** * Gets the next available sequence ID for signing when using executeAndConfirm * returns the sequenceId one higher than the highest currently stored */ function getNextSequenceId() returns (uint) { uint highestSequenceId = 0; for (uint i = 0; i < SEQUENCE_ID_WINDOW_SIZE; i++) { if (recentSequenceIds[i] > highestSequenceId) { highestSequenceId = recentSequenceIds[i]; } } return highestSequenceId + 1; } }
[{"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["7"]}, {"defect": "Unused_state_variable", "type": "Code_specification", "severity": "Low", "lines": ["111"]}, {"defect": "Integer_overflow_and_underflow", "type": "Code_specification", "severity": "High", "lines": ["303", "331"]}, {"defect": "Dependency_of_timestamp", "type": "Business_logic", "severity": "Medium", "lines": ["240"]}]
[{"check": "arbitrary-send", "impact": "High", "confidence": "Medium", "lines": {"Forwarder.sol": [76]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [297, 298, 299, 300, 301, 302]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [198]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [77]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [135]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [49]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [66]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [204]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [237]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [39]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [320]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [254]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [250]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [329]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [242]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [334]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [179]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [119]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [291]}}, {"check": "deprecated-standards", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [172]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [9]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [47, 48, 49, 50, 51, 52]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [11]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [343, 344, 345, 346, 347, 348, 349, 350, 351]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [75, 76, 77, 78]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [264, 265, 266, 263]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [216, 217, 218, 215]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [154, 155, 156]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [143, 144, 145, 146, 147, 148]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [64, 65, 66, 67, 68, 69, 58, 59, 60, 61, 62, 63]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [1]}}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "lines": {"Forwarder.sol": [62]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [76]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [48]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [177]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [51]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [181]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [206]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [68]}}, {"check": "timestamp", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [240]}}]
[{"error": "Transaction-Ordering Dependency.", "line": 48, "level": "Warning"}, {"error": "Transaction-Ordering Dependency.", "line": 76, "level": "Warning"}, {"error": "Re-Entrancy Vulnerability.", "line": 76, "level": "Warning"}, {"error": "Integer Overflow.", "line": 170, "level": "Warning"}, {"error": "Integer Overflow.", "line": 196, "level": "Warning"}]
[{"rule": "SOLIDITY_CALL_WITHOUT_DATA", "line": 76, "severity": 2}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 172, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 198, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 39, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 49, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 66, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 77, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 119, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 135, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 179, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 204, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 237, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 242, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 250, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 254, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 291, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 320, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 329, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 334, "severity": 1}, {"rule": "SOLIDITY_DEPRECATED_CONSTRUCTIONS", "line": 11, "severity": 1}, {"rule": "SOLIDITY_EXTRA_GAS_IN_LOOPS", "line": 275, "severity": 1}, {"rule": "SOLIDITY_EXTRA_GAS_IN_LOOPS", "line": 317, "severity": 1}, {"rule": "SOLIDITY_EXTRA_GAS_IN_LOOPS", "line": 345, "severity": 1}, {"rule": "SOLIDITY_GAS_LIMIT_IN_LOOPS", "line": 275, "severity": 2}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 1, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 38, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 48, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 65, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 76, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 118, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 133, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 177, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 203, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 235, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 240, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 248, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 252, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 290, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 318, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 326, "severity": 1}, {"rule": "SOLIDITY_REVERT_REQUIRE", "line": 331, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 76, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 230, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 289, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 297, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 9, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 11, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 30, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 47, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 58, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 75, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 132, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 143, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 154, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 170, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 196, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 215, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 263, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 273, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 343, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 111, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 112, "severity": 1}]
[{"constant":true,"inputs":[],"name":"parentAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenContractAddress","type":"address"}],"name":"flushTokens","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"flush","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"}],"name":"ForwarderDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenContractAddress","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"TokensFlushed","type":"event"}]
v0.4.16-nightly.2017.8.11+commit.c84de7fa
true
200
Default
false
bzzr://d0f8838ba17108a895d34ae8ef3bff4e0dc9d639c3c51921fee1d17eaa803721
OwnableDelegateProxy
0x1994c717ec123fe2830399fe4f0f3054c8e69ebc
Solidity
contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view returns (address) { return _upgradeabilityOwner; } /** * @dev Sets the address of the owner */ function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { _upgradeabilityOwner = newUpgradeabilityOwner; } /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address) { return _implementation; } /** * @dev Tells the proxy type (EIP 897) * @return Proxy type, 2 for forwarding proxy */ function proxyType() public pure returns (uint256 proxyTypeId) { return 2; } } contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Tells the type of proxy (EIP 897) * @return Type of proxy, 2 for upgradeable proxy */ function proxyType() public pure returns (uint256 proxyTypeId); /** * @dev Fallback function allowing to perform a delegatecall to the given implementation. * This function will return whatever the implementation call returns */ function () payable public { address _impl = implementation(); require(_impl != address(0)); assembly { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) switch result case 0 { revert(ptr, size) } default { return(ptr, size) } } } } contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, address newOwner); /** * @dev This event will be emitted every time the implementation gets upgraded * @param implementation representing the address of the upgraded implementation */ event Upgraded(address indexed implementation); /** * @dev Upgrades the implementation address * @param implementation representing the address of the new implementation to be set */ function _upgradeTo(address implementation) internal { require(_implementation != implementation); _implementation = implementation; emit Upgraded(implementation); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyProxyOwner() { require(msg.sender == proxyOwner()); _; } /** * @dev Tells the address of the proxy owner * @return the address of the proxy owner */ function proxyOwner() public view returns (address) { return upgradeabilityOwner(); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0)); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); } /** * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy. * @param implementation representing the address of the new implementation to be set. */ function upgradeTo(address implementation) public onlyProxyOwner { _upgradeTo(implementation); } /** * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy * and delegatecall the new implementation for initialization. * @param implementation representing the address of the new implementation to be set. * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function * signature of the implementation to be called with the needed payload */ function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner { upgradeTo(implementation); require(address(this).delegatecall(data)); } } contract OwnableDelegateProxy is OwnedUpgradeabilityProxy { constructor(address owner, address initialImplementation, bytes calldata) public { setUpgradeabilityOwner(owner); _upgradeTo(initialImplementation); require(initialImplementation.delegatecall(calldata)); } }
[{"defect": "DelegateCall", "type": "Function_call", "severity": "High", "lines": ["146", "158"]}, {"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["43"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["111", "9", "119"]}]
[{"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [55]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [123, 124, 125, 126, 127]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [36, 37, 38]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [144, 145, 146, 147]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 61, 62, 63]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [49]}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [49]}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [49]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [158]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [146]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"OwnableDelegateProxy.sol": [4]}}]
null
null
[{"constant":true,"inputs":[],"name":"proxyOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"implementation","type":"address"}],"name":"upgradeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"proxyType","outputs":[{"name":"proxyTypeId","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"implementation","type":"address"},{"name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"upgradeabilityOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferProxyOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"owner","type":"address"},{"name":"initialImplementation","type":"address"},{"name":"calldata","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"previousOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"ProxyOwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"implementation","type":"address"}],"name":"Upgraded","type":"event"}]
v0.4.23+commit.124ca40d
true
200
00000000000000000000000074451193ccf4d1c9182c973538d9d2339350ee1a000000000000000000000000f9e266af4bca5890e2781812cc6a6e89495a79f200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc95500000000000000000000000074451193ccf4d1c9182c973538d9d2339350ee1a000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c100000000000000000000000000000000000000000000000000000000
Default
MIT
false
bzzr://5f26049bbc794226b505f589b2ee1130db54310d79dd8a635c6f6c61e305a777
Proxy
0xeb623971dac04d3ac48dd97583dda06808fc691a
Solidity
pragma solidity ^0.5.3; /// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. /// @author Stefan George - <[email protected]> /// @author Richard Meissner - <[email protected]> contract Proxy { // masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt` address internal masterCopy; /// @dev Constructor function sets address of master copy contract. /// @param _masterCopy Master copy address. constructor(address _masterCopy) public { require(_masterCopy != address(0), "Invalid master copy address provided"); masterCopy = _masterCopy; } /// @dev Fallback function forwards all transactions and returns all received return data. function () external payable { // solium-disable-next-line security/no-inline-assembly assembly { let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) { mstore(0, masterCopy) return(0, 0x20) } calldatacopy(0, 0, calldatasize()) let success := delegatecall(gas, masterCopy, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) if eq(success, 0) { revert(0, returndatasize()) } return(0, returndatasize()) } } }
[{"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["6"]}]
[{"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"Proxy.sol": [32, 33, 34, 35, 36, 37, 38, 39, 27, 28, 29, 30, 31]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"Proxy.sol": [1]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "locked-ether", "impact": "Medium", "confidence": "High", "lines": {"Proxy.sol": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]}}]
[]
[{"rule": "SOLIDITY_LOCKED_MONEY", "line": 6, "severity": 3}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 1, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 27, "severity": 1}]
[{"inputs":[{"internalType":"address","name":"_masterCopy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]
v0.5.14+commit.1f1aaa4
false
200
00000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f
Default
MIT
false
bzzr://d8a00dc4fe6bf675a9d7416fc2d00bb3433362aa8186b750f76c4027269667ff
GnosisSafeProxy
0x7ce3eb23e26675fbb2596455440ffd7034e70954
Solidity
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain /// @author Richard Meissner - <[email protected]> interface IProxy { function masterCopy() external view returns (address); } /// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. /// @author Stefan George - <[email protected]> /// @author Richard Meissner - <[email protected]> contract GnosisSafeProxy { // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt` address internal singleton; /// @dev Constructor function sets address of singleton contract. /// @param _singleton Singleton address. constructor(address _singleton) { require(_singleton != address(0), "Invalid singleton address provided"); singleton = _singleton; } /// @dev Fallback function forwards all transactions and returns all received return data. fallback() external payable { // solhint-disable-next-line no-inline-assembly assembly { let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) { mstore(0, _singleton) return(0, 0x20) } calldatacopy(0, 0, calldatasize()) let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) if eq(success, 0) { revert(0, returndatasize()) } return(0, returndatasize()) } } } /// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @author Stefan George - <[email protected]> contract GnosisSafeProxyFactory { event ProxyCreation(GnosisSafeProxy proxy, address singleton); /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @param singleton Address of singleton contract. /// @param data Payload for message call sent to new proxy contract. function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) { proxy = new GnosisSafeProxy(singleton); if (data.length > 0) // solhint-disable-next-line no-inline-assembly assembly { if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) { revert(0, 0) } } emit ProxyCreation(proxy, singleton); } /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed. function proxyRuntimeCode() public pure returns (bytes memory) { return type(GnosisSafeProxy).runtimeCode; } /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address. function proxyCreationCode() public pure returns (bytes memory) { return type(GnosisSafeProxy).creationCode; } /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer. /// This method is only meant as an utility to be called from other methods /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function deployProxyWithNonce( address _singleton, bytes memory initializer, uint256 saltNonce ) internal returns (GnosisSafeProxy proxy) { // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce)); bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton))); // solhint-disable-next-line no-inline-assembly assembly { proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt) } require(address(proxy) != address(0), "Create2 call failed"); } /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function createProxyWithNonce( address _singleton, bytes memory initializer, uint256 saltNonce ) public returns (GnosisSafeProxy proxy) { proxy = deployProxyWithNonce(_singleton, initializer, saltNonce); if (initializer.length > 0) // solhint-disable-next-line no-inline-assembly assembly { if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) { revert(0, 0) } } emit ProxyCreation(proxy, _singleton); } /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized. function createProxyWithCallback( address _singleton, bytes memory initializer, uint256 saltNonce, IProxyCreationCallback callback ) public returns (GnosisSafeProxy proxy) { uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback))); proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback); if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce); } /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce` /// This method is only meant for address calculation purpose when you use an initializer that would revert, /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory. /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function calculateCreateProxyWithNonceAddress( address _singleton, bytes calldata initializer, uint256 saltNonce ) external returns (GnosisSafeProxy proxy) { proxy = deployProxyWithNonce(_singleton, initializer, saltNonce); revert(string(abi.encodePacked(proxy))); } } interface IProxyCreationCallback { function proxyCreated( GnosisSafeProxy proxy, address _singleton, bytes calldata initializer, uint256 saltNonce ) external; }
[{"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["13"]}, {"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["48"]}, {"defect": "Unused_state_variable", "type": "Code_specification", "severity": "Low", "lines": ["88"]}]
[{"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [90, 91, 92]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 28, 29, 30, 31]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [58, 59, 60, 61, 62]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [108, 109, 110, 111, 112]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [67, 68, 69]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [72, 73, 74]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [128, 129, 130, 121, 122, 123, 124, 125, 126, 127]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [64, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [2]}}, {"check": "locked-ether", "impact": "Medium", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 26, 27, 28, 29, 30, 31]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [139]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [122]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [82]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"GnosisSafeProxy.sol": [101]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"GnosisSafeProxy.sol": [88]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"GnosisSafeProxy.sol": [73]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"GnosisSafeProxy.sol": [68]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"GnosisSafeProxy.sol": [31]}}]
[]
[{"rule": "SOLIDITY_FUNCTIONS_RETURNS_TYPE_AND_NO_RETURN", "line": 81, "severity": 1}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 2, "severity": 1}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 2, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 58, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 90, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 108, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 20, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 138, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 149, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 26, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 29, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 29, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 33, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 35, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 35, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 36, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 36, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 36, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 36, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 37, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 37, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 37, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 38, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 39, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 39, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 39, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 140, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 141, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 142, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 144, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 144, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 144, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 144, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 152, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 153, "severity": 1}]
[{"inputs":[{"internalType":"address","name":"_singleton","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}]
v0.7.6+commit.7338295f
false
200
000000000000000000000000d9Db270c1B5E3Bd161E8c8503c55cEABeE709552
Default
GNU LGPLv3
false
ipfs://d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b9552
Forwarder
0x14bee40a811044821e8b546e7c8de502c4f7c90e
Solidity
pragma solidity 0.7.5; /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //solhint-disable max-line-length //solhint-disable no-inline-assembly contract CloneFactory { function createClone(address target, bytes32 salt) internal returns (address payable result) { bytes20 targetBytes = bytes20(target); assembly { // load the next free memory slot as a place to store the clone contract data let clone := mload(0x40) // The bytecode block below is responsible for contract initialization // during deployment, it is worth noting the proxied contract constructor will not be called during // the cloning procedure and that is why an initialization function needs to be called after the // clone is created mstore( clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 ) // This stores the address location of the implementation contract // so that the proxy knows where to delegate call logic to mstore(add(clone, 0x14), targetBytes) // The bytecode block is the actual code that is deployed for each clone created. // It forwards all calls to the already deployed implementation via a delegatecall mstore( add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) // deploy the contract using the CREATE2 opcode // this deploys the minimal proxy defined above, which will proxy all // calls to use the logic defined in the implementation contract `target` result := create2(0, clone, 0x37, salt) } } function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { // load the next free memory slot as a place to store the comparison clone let clone := mload(0x40) // The next three lines store the expected bytecode for a miniml proxy // that targets `target` as its implementation contract mstore( clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000 ) mstore(add(clone, 0xa), targetBytes) mstore( add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) // the next two lines store the bytecode of the contract that we are checking in memory let other := add(clone, 0x40) extcodecopy(query, other, 0, 0x2d) // Check if the expected bytecode equals the actual bytecode and return the result result := and( eq(mload(clone), mload(other)), eq(mload(add(clone, 0xd)), mload(add(other, 0xd))) ) } } } /** * Contract that exposes the needed erc20 token functions */ abstract contract ERC20Interface { // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) public virtual returns (bool success); // Get the account balance of another account with address _owner function balanceOf(address _owner) public virtual view returns (uint256 balance); } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } } /** * Contract that will forward any incoming Ether to the creator of the contract * */ contract Forwarder { // Address to which any funds sent to this contract will be forwarded address public parentAddress; event ForwarderDeposited(address from, uint256 value, bytes data); /** * Initialize the contract, and sets the destination address to that of the creator */ function init(address _parentAddress) external onlyUninitialized { parentAddress = _parentAddress; uint256 value = address(this).balance; if (value == 0) { return; } (bool success, ) = parentAddress.call{ value: value }(''); require(success, 'Flush failed'); // NOTE: since we are forwarding on initialization, // we don't have the context of the original sender. // We still emit an event about the forwarding but set // the sender to the forwarder itself emit ForwarderDeposited(address(this), value, msg.data); } /** * Modifier that will execute internal code block only if the sender is the parent address */ modifier onlyParent { require(msg.sender == parentAddress, 'Only Parent'); _; } /** * Modifier that will execute internal code block only if the contract has not been initialized yet */ modifier onlyUninitialized { require(parentAddress == address(0x0), 'Already initialized'); _; } /** * Default function; Gets called when data is sent but does not match any other function */ fallback() external payable { flush(); } /** * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address */ receive() external payable { flush(); } /** * Execute a token transfer of the full balance from the forwarder token to the parent address * @param tokenContractAddress the address of the erc20 token contract */ function flushTokens(address tokenContractAddress) external onlyParent { ERC20Interface instance = ERC20Interface(tokenContractAddress); address forwarderAddress = address(this); uint256 forwarderBalance = instance.balanceOf(forwarderAddress); if (forwarderBalance == 0) { return; } TransferHelper.safeTransfer( tokenContractAddress, parentAddress, forwarderBalance ); } /** * Flush the entire balance of the contract to the parent address. */ function flush() public { uint256 value = address(this).balance; if (value == 0) { return; } (bool success, ) = parentAddress.call{ value: value }(''); require(success, 'Flush failed'); emit ForwarderDeposited(msg.sender, value, msg.data); } } contract ForwarderFactory is CloneFactory { address public implementationAddress; event ForwarderCreated(address newForwarderAddress, address parentAddress); constructor(address _implementationAddress) { implementationAddress = _implementationAddress; } function createForwarder(address parent, bytes32 salt) external { // include the signers in the salt so any contract deployed to a given address must have the same signers bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt)); address payable clone = createClone(implementationAddress, finalSalt); Forwarder(clone).init(parent); emit ForwarderCreated(clone, parent); } }
[{"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["171"]}, {"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["171"]}, {"defect": "Unused_state_variable", "type": "Code_specification", "severity": "Low", "lines": ["31", "68", "274"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["176"]}]
[{"check": "arbitrary-send", "impact": "High", "confidence": "Medium", "lines": {"Forwarder.sol": [255]}}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium", "lines": {"Forwarder.sol": [187]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [160, 161, 162, 163]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [128, 129, 130, 131, 120, 121, 122, 123, 124, 125, 126, 127]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [105, 106, 107, 108]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"Forwarder.sol": [111, 112, 113, 114, 115]}}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "lines": {"Forwarder.sol": [251]}}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "lines": {"Forwarder.sol": [234]}}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High", "lines": {"Forwarder.sol": [183]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [126]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [187]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [161]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [255]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [153]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [139]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [267]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [180]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"Forwarder.sol": [179]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [257]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [276]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"Forwarder.sol": [193]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [80, 81, 82, 83]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [40, 41, 42, 43]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [75, 76, 77, 78]}}, {"check": "too-many-digits", "impact": "Informational", "confidence": "Medium", "lines": {"Forwarder.sol": [51, 52, 53, 54]}}]
[]
[{"rule": "SOLIDITY_ADDRESS_HARDCODED", "line": 126, "severity": 1}, {"rule": "SOLIDITY_ADDRESS_HARDCODED", "line": 139, "severity": 1}, {"rule": "SOLIDITY_ADDRESS_HARDCODED", "line": 153, "severity": 1}, {"rule": "SOLIDITY_ADDRESS_HARDCODED", "line": 208, "severity": 1}, {"rule": "SOLIDITY_UNCHECKED_CALL", "line": 126, "severity": 3}, {"rule": "SOLIDITY_UNCHECKED_CALL", "line": 139, "severity": 3}, {"rule": "SOLIDITY_UNCHECKED_CALL", "line": 153, "severity": 3}, {"rule": "SOLIDITY_VISIBILITY", "line": 266, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 29, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 34, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 34, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 40, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 47, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 47, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 51, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 52, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 59, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 59, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 59, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 215, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 216, "severity": 1}]
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"ForwarderDeposited","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"flush","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContractAddress","type":"address"}],"name":"flushTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_parentAddress","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"parentAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
v0.7.5+commit.eb77ed08
false
200
Default
Apache-2.0
false
ipfs://934a7b5f246917d20f5e049b9344e4f3d923110c9d150ea2a4118848dd414bc3
DSProxy
0x980cfcab781f1e6b1ea7c6a58097d8c6734a0de8
Solidity
// proxy.sol - execute actions atomically through the proxy's identity // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.4.23; contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; constructor() public { owner = msg.sender; emit LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; emit LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; emit LogSetAuthority(authority); } modifier auth { require(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } } contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } emit LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } // DSProxy // Allows code execution using a persistant identity This can be very // useful to execute a sequence of atomic actions. Since the owner of // the proxy can be changed, this allows for dynamic ownership models // i.e. a multisig contract DSProxy is DSAuth, DSNote { DSProxyCache public cache; // global cache for contracts constructor(address _cacheAddr) public { require(setCache(_cacheAddr)); } function() public payable { } // use the proxy to execute calldata _data on contract _code function execute(bytes _code, bytes _data) public payable returns (address target, bytes32 response) { target = cache.read(_code); if (target == 0x0) { // deploy contract & store its address in cache target = cache.write(_code); } response = execute(target, _data); } function execute(address _target, bytes _data) public auth note payable returns (bytes32 response) { require(_target != 0x0); // call contract in current context assembly { let succeeded := delegatecall(sub(gas, 5000), _target, add(_data, 0x20), mload(_data), 0, 32) response := mload(0) // load delegatecall output switch iszero(succeeded) case 1 { // throw if delegatecall failed revert(0, 0) } } } //set new cache function setCache(address _cacheAddr) public auth note returns (bool) { require(_cacheAddr != 0x0); // invalid cache address cache = DSProxyCache(_cacheAddr); // overwrite cache return true; } } // DSProxyFactory // This factory deploys new proxy instances through build() // Deployed proxy addresses are logged contract DSProxyFactory { event Created(address indexed sender, address indexed owner, address proxy, address cache); mapping(address=>bool) public isProxy; DSProxyCache public cache = new DSProxyCache(); // deploys a new proxy instance // sets owner of proxy to caller function build() public returns (DSProxy proxy) { proxy = build(msg.sender); } // deploys a new proxy instance // sets custom owner of proxy function build(address owner) public returns (DSProxy proxy) { proxy = new DSProxy(cache); emit Created(msg.sender, owner, address(proxy), address(cache)); proxy.setOwner(owner); isProxy[proxy] = true; } } // DSProxyCache // This global cache stores addresses of contracts previously deployed // by a proxy. This saves gas from repeat deployment of the same // contracts and eliminates blockchain bloat. // By default, all proxies deployed from the same factory store // contracts in the same cache. The cache a proxy instance uses can be // changed. The cache uses the sha3 hash of a contract's bytecode to // lookup the address contract DSProxyCache { mapping(bytes32 => address) cache; function read(bytes _code) public view returns (address) { bytes32 hash = keccak256(_code); return cache[hash]; } function write(bytes _code) public returns (address target) { assembly { target := create(0, add(_code, 0x20), mload(_code)) switch iszero(extcodesize(target)) case 1 { // throw if contract failed to deploy revert(0, 0) } } bytes32 hash = keccak256(_code); cache[hash] = target; } }
[{"defect": "Frozen_Ether", "type": "Code_specification", "severity": "Medium", "lines": ["104"]}, {"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["166", "20", "196"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["40"]}]
[{"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [139, 140, 141, 142, 143, 144, 145, 146, 147, 148]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [205, 206, 207, 208, 209, 210, 211, 212, 213]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [40, 41, 42, 43, 44, 45, 46]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [200, 201, 202, 199]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [173, 174, 175]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [21, 22, 23]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [112, 111]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"DSProxy.sol": [48, 49, 50, 51, 52, 53, 54]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [18]}}, {"check": "locked-ether", "impact": "Medium", "confidence": "High", "lines": {"DSProxy.sol": [129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [44]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [151]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [115]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [204]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [199]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [129]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"DSProxy.sol": [115]}}, {"check": "reentrancy-benign", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [183]}}, {"check": "reentrancy-benign", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [158]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [181]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [45]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [132]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [154]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [53]}}, {"check": "reentrancy-events", "impact": "Low", "confidence": "Medium", "lines": {"DSProxy.sol": [126]}}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium", "lines": {"DSProxy.sol": [52]}}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium", "lines": {"DSProxy.sol": [44]}}]
[{"error": "Integer Overflow.", "line": 129, "level": "Warning"}, {"error": "Integer Overflow.", "line": 115, "level": "Warning"}, {"error": "Integer Overflow.", "line": 199, "level": "Warning"}, {"error": "Integer Overflow.", "line": 204, "level": "Warning"}]
[{"rule": "SOLIDITY_FUNCTIONS_RETURNS_TYPE_AND_NO_RETURN", "line": 129, "severity": 1}, {"rule": "SOLIDITY_FUNCTIONS_RETURNS_TYPE_AND_NO_RETURN", "line": 204, "severity": 1}, {"rule": "SOLIDITY_LOCKED_MONEY", "line": 104, "severity": 3}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 18, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 111, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 115, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 115, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 129, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 199, "severity": 1}, {"rule": "SOLIDITY_UPGRADE_TO_050", "line": 204, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 88, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 139, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 205, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 197, "severity": 1}]
[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_target","type":"address"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"response","type":"bytes32"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_code","type":"bytes"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"target","type":"address"},{"name":"response","type":"bytes32"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"cache","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_cacheAddr","type":"address"}],"name":"setCache","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_cacheAddr","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]
v0.4.23+commit.124ca40d
true
200
000000000000000000000000271293c67e2d3140a0e9381eff1f9b01e07b0795
Default
false
bzzr://e498874c9ba9e75028e0c84f1b1d83b2dad5de910c59b837b32e5a190794c5e1
ReversibleDemo
0xf24b424fe9aeb87baad995aa807decae29bf91c2
Solidity
// `interface` would make a nice keyword ;) contract TheDaoHardForkOracle { // `ran()` manually verified true on both ETH and ETC chains function forked() constant returns (bool); } // demostrates calling own function in a "reversible" manner /* important lines are marked by multi-line comments */ contract ReversibleDemo { // counters (all public to simplify inspection) uint public numcalls; uint public numcallsinternal; uint public numfails; uint public numsuccesses; address owner; // needed for "naive" and "oraclized" checks address constant withdrawdaoaddr = 0xbf4ed7b27f1d666546e30d74d50d173d20bca754; TheDaoHardForkOracle oracle = TheDaoHardForkOracle(0xe8e506306ddb78ee38c9b0d86c257bd97c2536b3); event logCall(uint indexed _numcalls, uint indexed _numfails, uint indexed _numsuccesses); modifier onlyOwner { if (msg.sender != owner) throw; _ } modifier onlyThis { if (msg.sender != address(this)) throw; _ } // constructor (setting `owner` allows later termination) function ReversibleDemo() { owner = msg.sender; } /* external: increments stack height */ /* onlyThis: prevent actual external calling */ function sendIfNotForked() external onlyThis returns (bool) { numcallsinternal++; /* naive check for "is this the classic chain" */ // guaranteed `true`: enough has been withdrawn already // three million ------> 3'000'000 if (withdrawdaoaddr.balance < 3000000 ether) { /* intentionally not checking return value */ owner.send(42); } /* "reverse" if it's actually the HF chain */ if (oracle.forked()) throw; // not exactly a "success": send() could have failed on classic return true; } // accepts value transfers function doCall(uint _gas) onlyOwner { numcalls++; if (!this.sendIfNotForked.gas(_gas)()) { numfails++; } else { numsuccesses++; } logCall(numcalls, numfails, numsuccesses); } function selfDestruct() onlyOwner { selfdestruct(owner); } // accepts value trasfers, but does nothing function() {} }
[{"defect": "Unchecked_send", "type": "Function_call", "severity": "High", "lines": ["42"]}, {"defect": "Erroneous_constructor_name", "type": "Access_control", "severity": "Medium", "lines": ["2"]}, {"defect": "Unused_state_variable", "type": "Code_specification", "severity": "Low", "lines": ["12"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["30"]}]
null
null
null
[{"constant":true,"inputs":[],"name":"numsuccesses","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numfails","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numcalls","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numcallsinternal","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"sendIfNotForked","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"selfDestruct","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_gas","type":"uint256"}],"name":"doCall","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_numcalls","type":"uint256"},{"indexed":true,"name":"_numfails","type":"uint256"},{"indexed":true,"name":"_numsuccesses","type":"uint256"}],"name":"logCall","type":"event"}]
v0.3.5-2016-08-07-f7af7de
true
200
Default
false
USDOGE
0xcdb8ceabf7f5ca49039404f6a20f54421aca983e
Solidity
/* */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } 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 sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract USDOGE is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
[{"defect": "Uninitialized_storage", "type": "Code_specification", "severity": "Low", "lines": ["355", "319", "370", "245"]}, {"defect": "Exceed_authority_access", "type": "Access_control", "severity": "Medium", "lines": ["202", "179", "197"]}, {"defect": "Dependency_of_timestamp", "type": "Business_logic", "severity": "Medium", "lines": ["246", "326", "359"]}]
[{"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [27]}}, {"check": "assembly", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [72, 69, 70, 71]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [380]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [209]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [322]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [215]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [388]}}, {"check": "boolean-equal", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [193]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [99, 100, 101, 102, 103, 104, 105, 106, 107, 108]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [32, 33, 34, 35, 36, 37, 31]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [48, 49, 47]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [128, 129, 126, 127]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [51, 52, 53, 54]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [114, 115, 116, 117, 118, 119, 120]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [16, 13, 14, 15]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [122, 123, 124]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [112, 110, 111]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [43, 44, 45]}}, {"check": "dead-code", "impact": "Informational", "confidence": "Medium", "lines": {"USDOGE.sol": [40, 41, 39]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [202, 203, 204, 205, 206]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [308, 309, 310, 311]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [304, 305, 306, 303]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [288, 289, 290, 287]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [276, 277, 278, 279, 280]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [240, 241, 242]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [261, 262, 263]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [208, 209, 210, 211, 212]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [228, 229, 230]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [232, 233, 234]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [214, 215, 216, 217, 218]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [313, 314, 315, 316]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [282, 283, 284, 285]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [265, 266, 267, 268]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [297, 298, 299, 300]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [179, 180, 181]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [220, 221, 222]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [292, 293, 294, 295]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [236, 237, 238]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [256, 257, 258, 259]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [200, 197, 198, 199]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [270, 271, 272, 273, 274]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [184, 185, 183]}}, {"check": "external-function", "impact": "Optimization", "confidence": "High", "lines": {"USDOGE.sol": [224, 225, 226]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [6]}}, {"check": "solc-version", "impact": "Informational", "confidence": "High", "lines": {}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"USDOGE.sol": [220, 221, 222]}}, {"check": "shadowing-local", "impact": "Low", "confidence": "High", "lines": {"USDOGE.sol": [224, 225, 226]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [60]}}, {"check": "low-level-calls", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [35]}}, {"check": "missing-zero-check", "impact": "Low", "confidence": "Medium", "lines": {"USDOGE.sol": [173]}}, {"check": "naming-convention", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [147, 148, 149, 150]}}, {"check": "redundant-statements", "impact": "Informational", "confidence": "High", "lines": {"USDOGE.sol": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17]}}, {"check": "timestamp", "impact": "Low", "confidence": "Medium", "lines": {"USDOGE.sol": [359]}}, {"check": "timestamp", "impact": "Low", "confidence": "Medium", "lines": {"USDOGE.sol": [246]}}, {"check": "timestamp", "impact": "Low", "confidence": "Medium", "lines": {"USDOGE.sol": [326]}}]
[]
[{"rule": "SOLIDITY_ADDRESS_HARDCODED", "line": 199, "severity": 1}, {"rule": "SOLIDITY_ERC20_APPROVE", "line": 265, "severity": 2}, {"rule": "SOLIDITY_LOCKED_MONEY", "line": 143, "severity": 3}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 6, "severity": 1}, {"rule": "SOLIDITY_PRAGMAS_VERSION", "line": 6, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 152, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 153, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 154, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 155, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 156, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 158, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 159, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 160, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 161, "severity": 1}, {"rule": "SOLIDITY_PRIVATE_MODIFIER_DONT_HIDE_DATA", "line": 162, "severity": 1}, {"rule": "SOLIDITY_SAFEMATH", "line": 144, "severity": 1}, {"rule": "SOLIDITY_SHOULD_NOT_BE_VIEW", "line": 20, "severity": 1}, {"rule": "SOLIDITY_SHOULD_RETURN_STRUCT", "line": 244, "severity": 1}, {"rule": "SOLIDITY_USING_INLINE_ASSEMBLY", "line": 27, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 168, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 31, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 32, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 35, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 35, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 35, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 292, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 293, "severity": 1}, {"rule": "SOLIDITY_VISIBILITY", "line": 293, "severity": 1}]
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":true,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"dateLockUntil","type":"uint256"}],"name":"LockUntil","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":true,"internalType":"bool","name":"status","type":"bool"}],"name":"PutToBlacklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"funder","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"targetaddress","type":"address"}],"name":"blacklistTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"targetaddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldAdmin","type":"address"}],"name":"demoteAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getLockInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBlackList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"targetaddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"}],"name":"lockTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"promoteAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"}],"name":"transferAndLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"targetaddress","type":"address"}],"name":"unblacklistTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"targetaddress","type":"address"}],"name":"unlockTarget","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
v0.7.3+commit.9bfce1f6
true
200
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000314dc6448d9338c15b0a00000000000000000000000000000000000000000000000000000000000000000000000d416d65726963616e20446f67650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065553444f47450000000000000000000000000000000000000000000000000000
Default
MIT
false
ipfs://121516d17af92dafa3dc013dc4b17a9775e25e0efa479afa06727954b2554f48
MethodVaultV2
0x6401e2ff943722e8583d0f7b99987e7b39f9cc75
Solidity
"// File: contracts/methodNFT/MethodVaultV2.sol\n\n\n\n// SPDX-License-Identifier: GPL-3.0-only\npra(...TRUNCATED)
null
"[{\"check\": \"pragma\", \"impact\": \"Informational\", \"confidence\": \"High\", \"lines\": {\"@op(...TRUNCATED)
[]
"[{\"rule\": \"SOLIDITY_ADDRESS_HARDCODED\", \"line\": 1170, \"severity\": 1}, {\"rule\": \"SOLIDITY(...TRUNCATED)
"[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operat(...TRUNCATED)
v0.7.6+commit.7338295f
true
1,000
Default
false

No dataset card yet

New: Create and edit this dataset card directly on the website!

Contribute a Dataset Card
Downloads last month
3
Add dataset card