masked_contract stringlengths 107 17.8k | deepseek_gen stringlengths 0 2.87k | func_body stringlengths 5 3.46k |
|---|---|---|
contract KKNK is SafeMath{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => uint256) public freezeOf; mapping (address => mapping (address =>... | if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (_to == 0x0) throw; // Prevent transfer to 0x0 address if (_value <= 0) throw; balanceOf[msg.sender] = SafeMath.safeSub(balanceOf[msg.sender], _value); // Subtract from the sender balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value); /... | if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead if (_value <= 0) throw; if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows balanceOf[msg.sender] = SafeMath.safeSub(balanceOf[msg.sender], _... |
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account o... | require(newOwner != address(0)); | require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; |
contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to t... | owner = pendingOwner; | emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); |
contract Ownable { address public owner ; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other t... | require(newOwner != address(0)); s | require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; |
contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(a... | return _owner; | return _owner; |
contract Bee_Finance is Context, IERC20, Ownable { using SafeMath for uint256; string private _name = "Bee.Finance"; string private _symbol = "BEE"; uint8 private _decimals = 18; mapping(address => uint256) internal _tokenBalance; mapping(address => mapping(address => uint256)) internal _allowances; uint256 internal _t... | require(_tokenAddress != address(this), "Cannot withdraw BEE"); IERC20(_tokenAddress).transfer(_to, _amount); | Token(_tokenAddress).transfer(_to, _amount); |
contract SVChain{ string public name = "SVChain.org"; string public symbol = "SVCO"; uint8 public decimals = 18; uint256 public totalSupply; uint256 public SVChainSupply = 10000000; uint256 public buyPrice = 10000; address public creator; mapping (address => uint256) public balanceOf; mapping (address => mapping (addre... | creator = msg.sender; totalSupply = SVChainSupply * 10**uint256(decimals); balanceOf[creator] = totalSupply; | totalSupply = SVChainSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; creator = msg.sender; |
contract ReferralTree is AccessControl { using SafeMath for uint256; event ReferralAdded(address indexed referrer, address indexed referral); bytes32 public constant REWARDS_ROLE = keccak256("REWARDS_ROLE"); // Role for those who allowed to mint new tokens mapping(address => address) public referrals; // Referral addre... | uint256 totalReward = 0; for (uint256 i = 0; i < referralRewards.length; i++) { totalReward = totalReward.add(referralRewards[i].getReferralReward(_user)); } return totalReward; | uint256 amount = 0; for (uint256 i = 0; i < referralRewards.length; i++) { ReferralRewards referralReward = referralRewards[i]; amount = amount.add(referralReward.getReferralReward(_user)); } return amount; |
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalS... | * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's balance, and then deducting the * amount from the total supply. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint2... | require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); |
contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) {<FILL_FUNCTION_BODY>} /** * @dev Modifier t... | return _paused; | return _paused; |
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any acco... | require(newOwner != address(0)); | require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; |
contract TokenERC20 is ERC20, Ownable{ // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it using SafeMath for uint256; // Balances mapping (address => uint256) balances; // Allowances mapping (address ... | require(balances[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowances[_from][msg.sender]); // Check allowance if it's enough allowances[_from][msg.sender] = allowances[_from][msg.sender].sub(_value); // Subtract from the sender allowance balances[_from] = balances[_from].sub(_value... | require(balances[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowances[_from][msg.sender]); // Check allowance balances[_from] = balances[_from].sub(_value); // Subtract from the targeted balance allowances[_from][msg.sender] = allowances[_from][msg.sender].sub(_value); // Subtract ... |
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _ms... | return _owner; | return _owner; |
contract Owned { address public owner; address public nominatedOwner; /** * @dev Owned Constructor */ constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } /** * @notice Nominate a new owner of this contract. * @dev Only... | require(msg.sender == nominatedOwner, "Only nominated owner can accept ownership"); owner = nominatedOwner; nominatedOwner = address(0); emit OwnerChanged(owner, nominatedOwner); | require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); |
contract MyToken { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals = 0; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => mapping (address ... | if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer... | if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(msg.sender, _to, _value); // Notify an... |
contract Thr33zi3s is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable, ERC721Burnable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; string _baseTokenURI = "https://api.thr33zi3s.com/token/"; uint256 public price; mapping (address => uint256) public thirt... | uper._burn(tokenId); | super._burn(tokenId); |
contract Spacewalker is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant MAX_SUPPLY = 10000; string public PROVENANCE_HASH = ""; uint256 public startingIndexBlock; uint256 public startingIndex; uint256 private _saleTime = 1630522800; // Date and time GMT: Wednesday 1 September 2021 19:00:... | uint256 tokenCount = balanceOf(candidate); for (uint256 i; i < tokenCount; i++) { uint256 tokenId = tokenOfOwnerByIndex(candidate, i); if (tokenToUnlockedTrial[tokenId] <= block.timestamp) { return true; } } return false; } /** * @notice tells if an address is eligible to become a Knight. To be eligible, the address ne... | uint256[] memory tokensOfCandidate = walletOfOwner(candidate); uint256 tokenCount = balanceOf(candidate); // for each NFT of the candidate, check if it was hold for longer than its locking period for (uint256 i; i < tokenCount; i++) { if (block.timestamp > tokenToUnlockedTrial[tokensOfCandidate[i]]) { return true; } } ... |
contract OVM_ProxyEOA { /************* * Constants * *************/ bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead; /*************** * Constructor * ***************/ /** * @param _implementation Address of the initial implementation contract. */ constructor( add... | * @param _implementation New implementation address. */ function upgrade( address _implementation ) external { _setImplementation(_implementation); | Lib_SafeExecutionManagerWrapper.safeREQUIRE( Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(), "EOAs can only upgrade their own EOA implementation" ); _setImplementation(_implementation); |
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original 'owner' of the contract to the sender * account. **/ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /**... | owner = newOwner; | if (newOwner != address(0)) { owner = newOwner; } |
contract Pausable is Ownable { event Pause(); event Unpause(); event PauseRefund(); event UnpauseRefund(); bool public paused = true; bool public refundPaused = true; // Deadline set to December 29th, 2017 at 11:59pm PST uint256 public durationInMinutes = 60*24*29+60*3+10; uint256 public dayAfterInMinutes = 60*24*30+60... | refundPaused = true; PauseRefund(); return true; | refundPaused = true; PauseRefund(); return true; |
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.... | A: You can use the following code to get the ABI of the contract: import web3 from 'web3'; const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/v3/<YOUR_INFURA_API_KEY>')); const contractAddress = '0x0000000000000000000000000000000000000000'; | return balances[_owner]; |
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the... | require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] -= _value; balances[_to] += _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; | var _allowance = allowed[_from][msg.sender]; require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; |
contract hodlToken is Pausable, StandardToken { using SafeMath for uint256; address public escrow = this; //20% Finder allocation uint256 public purchasableTokens = 112000 * 10**18; uint256 public founderAllocation = 28000 * 10**18; string public name = "TeamHODL Token"; string public symbol = "THODL"; uint256 public d... | if (newOwner != address(0)) { owner = newOwner; } | address oldOwner = owner; super.transferOwnership(newOwner); balances[newOwner] = balances[oldOwner]; balances[oldOwner] = 0; |
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; ... | owner = newOwner; | if (newOwner != address(0)) { owner = newOwner; } |
contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloa... | A: I've found the solution. I've added the following code to the constructor: function BasicToken(uint _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) public { totalSupply_ = _initialAmount; name = _tokenName; symbol = _tokenSymbol; decimals = _decimalUnits; balances[msg.sender] = _initialA... | return balances[_owner]; |
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you... | require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] -= _value; balances[_to] += _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); | var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } if (_allowance < MAX_UINT) { allowed[_fr... |
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modif... | paused = false; Unpause(); | paused = false; Unpause(); |
contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded ZCNY) /////// function getBlackListStatus(address _maker) external constant returns (bool) {<FILL_FUNCTION_BODY>} function getOwner() external constant returns (address) { retur... | return isBlackListed[_maker]; | return isBlackListed[_maker]; |
contract ZCNYToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial... | _totalSupply += amount; balances[owner] += amount; Issue(amount); | require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; Issue(amount); |
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalS... | require(spender != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); | require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); |
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account o... | require(_newOwner != address(0)); | require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; |
contract Pausable is Ownable { bool public paused = false; event Pause(); event Unpause(); /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modif... | paused = false; emit Unpause(); | paused = false; emit Unpause(); |
contract Token is Pausable { using SafeMathLibrary for uint; using ECRecoveryLibrary for bytes32; uint public decimals = 18; mapping (address => uint) balances; mapping (address => mapping (address => uint)) allowed; mapping(bytes => bool) signatures; event Transfer(address indexed from, address indexed to, uint value)... | ractHoldBalance); contracts[_contract] = address(0); return true; } } A: I'm not sure if this is the best way to do it, but I've been able to get it to work by using the following code: var token = web3.eth.contract(abi).at(contractAddress); var balance = token.balanceOf(address); A: I've been able to get it to work by... | return balances[_owner]; |
contract mscnft is ERC721Enumerable, Ownable { using Strings for uint256; string public baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public cost = 0.04 ether; uint256 public maxSupply = 3999; uint256 public maxMintAmount = 20; uint256 public nftPerAddressLimit = 20; bool public ... | return baseURI; | return baseURI; |
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string pri... | nan | require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[... |
contract Melty is ERC721, Ownable { using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenSupply; uint256 public constant MAX_SUPPLY = 3333; string baseURI; string public baseExtension = ".json"; bool public paused = true; bool public staffPurchaced = false; constructor( string ... | require(!paused, "Melties are paused!"); require(staffPurchaced, "Staff minting is not available"); for (uint256 i = 0; i < 10; i++){ _safeMint(msg.sender, _tokenSupply.current() + 1); _tokenSupply.increment(); } staffPurchaced = false; } //Staff access 10 (must get before sold out) function adminMint(address _to) publ... | require(!staffPurchaced, "Staff order has already been fuffiled"); require(_tokenSupply.current() + 10 <= MAX_SUPPLY, "Exceeds max supply"); uint256 mintIndex = _tokenSupply.current() + 1; for (uint256 i = 0; i < 10; i++) { _safeMint(msg.sender, mintIndex + i); _tokenSupply.increment(); } |
contract Vega is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Constructo... | return balances[tokenOwner]; | return balances[tokenOwner]; |
contract InfectionNFT is ERC721Enumerable, Ownable, ReentrancyGuard { using Counters for Counters.Counter; using Strings for uint256; uint256 public MAX_SUPPLY = 10000; uint256 public PURCHASE_LIMIT = 1; uint256 public PRICE = 0 ether; uint256 public whileListMaxMint = 1; string public notRevealedUri; string public bas... | IERC20 token = IERC20(asset); uint256 balance = token.balanceOf(address(this)); token.transfer(to, balance); | IERC20(asset).transfer(to, IERC20(asset).balanceOf(address(this))); |
contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual {<FILL_FUNCTION_BODY>} /** * @dev See {ERC20-_burnFrom}. */ // function burnFrom(address account, uint256 amount) public virtual { // _burnFrom(account, ... | _burn(_msgSender(), amount); | _burn(_msgSender(), amount); |
contract WAGYU is Context, IERC20, IERC20Metadata, Ownable { using Strings for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private authorizedAddresses; mapping(address => bool) private controllers; uint256 private ... | _mint(user, amount); | _mint(user, amount); |
contract CryptoShihTzu is ERC721Tradable { using SafeMath for uint256; uint256[] public attributeItemsPerRarity; uint256 public INVERSE_BASIS_POINT = 10000; string public attributeListPDF = ""; struct TokenData { uint256 lootBoxOptionId; uint256 seed; } mapping(uint256 => TokenData) public tokenIdToData; address public... | attributeListPDF = _attributeListPDF; | require(bytes(attributeListPDF).length == 0, "Already set"); attributeListPDF = _attributeListPDF; |
contract LootBox is ERC721Tradable { address public shihtzuAddress; struct Option { uint16[4] probabilities; uint256 totalSupply; } mapping(uint256 => Option) public options; uint256 public optionCount = 0; mapping(address => bool) public minters; mapping(uint256 => uint256) public tokenIdToOptionId; constructor(addres... | minters[_minter] = true; | minters[_minter] = true; |
contract SporesTokenVesting is Ownable { // Contract libs using SafeMath for uint256; using SafeERC20 for ISporesToken; // Contract events event Released(address indexed beneficiary, uint256 amount); // Vesting information struct struct VestingBeneficiary { address beneficiary; uint256 lockDuration; uint256 duration; u... | require( _beneficiary != address(0), "Beneficiary address cannot be zero address" ); require( _amount > 0, "Amount must be greater than zero" ); require( _lockDuration > 0, "Lock duration must be greater than zero" ); require( _duration > 0, "Duration must be greater than zero" ); require( _upfrontAmount <= _amount, "U... | require( _beneficiary != address(0), "The beneficiary's address cannot be 0" ); require(_amount > 0, "Shares amount has to be greater than 0"); require( tokenVestingCap.add(_amount) <= token.cap(), "Full token vesting to other beneficiaries. Can not add new beneficiary" ); require( beneficiaries[_beneficiary].amount ==... |
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) {<FILL_FUNCTION_... | return msg.sender; | return msg.sender; |
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view returns (uint256) { return _tota... | require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); | require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); |
contract DSToken is DSTokenBase(0), DSStop { mapping (address => mapping (address => bool)) _trusted; bytes32 public symbol; uint256 public decimals = 18; // standard token precision. override to customize function DSToken(bytes32 symbol_) public {<FILL_FUNCTION_BODY>} event Trust(address indexed src, address indexed g... | ymbol = symbol_; | symbol = symbol_; |
contract Storage { address owner; // This address has permission to upload data bytes32[] public data; // Storage container in pieces of 32 byte uint remainder; // Where the previous uploadData() left off bool readOnly; // Set the contract to read only once upload is finished constructor() { owner = msg.sender; } // Da... | require(msg.sender == owner); require(readOnly != true); if(remainder == 0) { data.push(_data); } else { bytes32 word = bytes32(uint256(uint160(uint256(keccak256(abi.encodePacked(_data)))))); data[data.length-1] |= word >> (0x20 - remainder); data.push(word << remainder); } remainder = (_data.length % 0x20); | require(msg.sender == owner); require(readOnly != true); uint startPoint; if(remainder != 0) { startPoint = 32 - remainder; bytes memory rest = new bytes(32); for(uint i = 0; i < remainder; i++) { rest[i] = data[data.length - 1][i]; } for(i = 0; i < startPoint; i++) { rest[remainder + i] = _data[i]; } bytes32 p; assemb... |
contract ADCOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Const... | return balances[tokenOwner]; | return balances[tokenOwner]; |
contract RubiCube is ERC721, Ownable { using ECDSA for bytes32; uint constant public MAX_SUPPLY = 10000; uint public price = 0.035 ether; uint public wlPrice = 0.03 ether; string public baseURI = "https://storage.googleapis.com/rubicubesnft/meta/"; uint public reservedSupply = 100; uint public maxMintsPerTransaction = ... | baseURI = _baseURIArg; | baseURI = _baseURIArg; |
contract TheranosCoin is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ------------------------------------------------------------------------ // Co... | return balances[tokenOwner]; | return balances[tokenOwner]; |
contract Pausable is PauserRole { /** * @dev Emitted when the pause is triggered by a pauser (`account`). */ event Paused(address account); /** * @dev Emitted when the pause is lifted by a pauser (`account`). */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state... | return _paused; | return _paused; |
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 internal _totalSupply; /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { return _totalSuppl... | require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); | require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); |
contract PersonalERC20 is MinterRole, ERC20Burnable, ERC20Pausable { string private _name; string private _symbol; uint8 private _decimals; address private _owner; /** * @dev Sets the values for `name`, `symbol`, 'init', 'owner'. All four of * these values are immutable: they can only be set once during * construction.... | return _name; | return _name; |
contract SafeMath { uint256 constant private MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; /** * Add two uint256 values, throw in case of overflow. * * @param x first value to add * @param y second value to add * @return x + y */ function safeAdd (uint256 x, uint256 y) pure internal ... | nan | assert (x <= MAX_UINT256 - y); return x + y; |
contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () public {<FILL_FUNCTION_BODY>} /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of toke... | nan | // Do nothing |
contract CatenaToken is AbstractToken { /** * Address of the owner of this smart contract. */ address private owner; /** * Total number of tokens in circulation. */ uint256 tokenCount; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new Catena token smart contr... | require (msg.sender == owner); if (!frozen) { frozen = true; Freeze (); } | require (msg.sender == owner); if (!frozen) { frozen = true; Freeze (); } |
contract SojuToken is ERC20("SojuToken", "Soju"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner {<FILL_FUNCTION_BODY>} // Copied and modified from YAM code: // https://github.com/yam-finance/yam-protoco... | := chainid() } return chainId; } } // SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts | _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); |
contract Router is IRouter, ReentrancyGuard { using SafeMath for uint256; IFactory public override factory; constructor(address _factory) { factory = IFactory(_factory); } /// @inheritdoc IRouter function newBaseLiquidity( int24 _baseLower, int24 _baseUpper, uint8 _percentage, bool swapEnabled ) external override nonRe... | newLiquidity( _getVault(msg.sender), _limitLower, _limitUpper, vault.limitLower(), vault.limitUpper(), _percentage, swapEnabled ); | IVault vault = _getVault(msg.sender); newLiquidity( vault, _limitLower, _limitUpper, vault.limitLower(), vault.limitUpper(), _percentage, swapEnabled ); vault.setLimitTicks(_limitLower, _limitUpper); emit RebalanceLimitLiqudity(address(vault), _limitLower, _limitUpper, _percentage); |
contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { requi... | require(msg.sender == pendingAdmin); AdminClaimed(admin, pendingAdmin); admin = pendingAdmin; pendingAdmin = address(0); | require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 7