Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 1 new columns ({'finetune_output'})
This happened while the json dataset builder was generating data using
hf://datasets/zhaospei/refine-v2/test.jsonl (at revision f1e1bf057ac0fb1e0310cce163bfe4404c6c7b45)
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2256, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
file_name: string
file_address: string
contract_name: string
func_name: string
masked_contract: string
func_body: string
func_requirement: string
deepseek_output: string
finetune_output: string
to
{'file_name': Value(dtype='string', id=None), 'file_address': Value(dtype='string', id=None), 'contract_name': Value(dtype='string', id=None), 'func_name': Value(dtype='string', id=None), 'masked_contract': Value(dtype='string', id=None), 'func_body': Value(dtype='string', id=None), 'func_requirement': Value(dtype='string', id=None), 'deepseek_output': Value(dtype='string', id=None)}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1321, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 935, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2013, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 1 new columns ({'finetune_output'})
This happened while the json dataset builder was generating data using
hf://datasets/zhaospei/refine-v2/test.jsonl (at revision f1e1bf057ac0fb1e0310cce163bfe4404c6c7b45)
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
file_name string | file_address string | contract_name string | func_name string | masked_contract string | func_body string | func_requirement string | deepseek_output string |
|---|---|---|---|---|---|---|---|
ZrxAllowlist | 0x019739e288973f92bdd3c1d87178e206e51fd911 | AdminAuth | setAdminByAdmin | contract AdminAuth {
address public owner;
address public admin;
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
constructor() public {
owner = msg.sender;
}
/// @notice Admin is set by owner first time, after that admin is super role and h... |
require(msg.sender == admin);
admin = _admin;
| / @notice Admin is able to set new admin
/ @param _admin Address of multisig that becomes new admin |
require(msg.sender == admin);
admin = _admin;
|
MoInke | 0xe29f3dca4e88ca781c4f9aadf9c0b1180aaa0add | MoInkeGold | goldTotalSupply | contract MoInkeGold is ERC20Interface, Administration, SafeMath {
event GoldTransfer(address indexed from, address indexed to, uint tokens);
string public goldSymbol;
string public goldName;
uint8 public goldDecimals;
uint public _goldTotalSupply;
mapping(address => uint) goldBalan... |
return _goldTotalSupply - goldBalances[address(0)];
| ------------------------------------------------------------------------
Total supply
------------------------------------------------------------------------ |
return _goldTotalSupply;
|
Token | 0x55c182de8e3b6c19d58dde95d70c38e25394b186 | Pausable | pause | 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 ... |
paused = true;
Pause();
| *
* @dev called by the owner to pause, triggers stopped state |
paused = true;
Pause();
|
OrionERC1155 | 0x15161e5a8bb7d30df89857e3b6d110e04eeeb489 | ERC1155PresetMinterPauser | unpause | contract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
/**
* @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PA... |
require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to unpause");
_unpause();
| *
* @dev Unpauses all token transfers.
*
* See {ERC1155Pausable} and {Pausable-_unpause}.
*
* Requirements:
*
* - the caller must have the `PAUSER_ROLE`. |
require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to unpause");
_unpause();
|
TokenERC20 | 0x3dc80c0fefd20a195b8e749a73179dad6010e0c1 | TokenERC20 | transferFrom | contract TokenERC20 {
// 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
uint256 public totalSupply;
// This creates an array with all balances
mapping (address... |
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
| *
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send |
require(_value <= balanceOf[_from]); // Check allowance
require(_value <= allowance[_from][msg.sender]);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
emit Transfer(_from, _to, _value);
return true;
... |
McFlyCrowd | 0xc7c6d400b1bcf7841a1b5061a4d69525c9aa0966 | McFlyToken | transferFrom | contract McFlyToken is MintableToken {
string public constant name = "McFlyToken";
string public constant symbol = "McFLY";
uint8 public constant decimals = 18;
/// @dev mapping for whitelist
mapping(address=>bool) whitelist;
/// @dev event throw when allowed to transfer address added ... |
return super.transferFrom(from, to, value);
| / @dev Do the transfer from address to address value
/ @param from address from
/ @param to address to
/ @param value uint256 |
return super.transferFrom(from, to, value);
|
FlibaInu | 0x85ba0079c8710071067fb5acaaca844d35d60833 | Ownable | transferOwnership | 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();
... |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
|
HeadFarmer | 0xae4b9dffa665d4f4cef3ae88173789e8fdf7fde1 | Ownable | transferOwnership | 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 () internal {
address msgSender = _msgSender();
... |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
|
EtherbotsCore | 0xd2f81cd7a20d60c0d558496c7169a20968389b40 | Ownable | transferOwnership | 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;
}
... |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
|
RewardsMinter | 0xd28130c3f252ae8a7931608d1820341685c5ae6c | BurnableToken | burn | contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {<FILL_FUNCTION_BODY>}
function _burn(address _who, uint256 _val... |
_burn(msg.sender, _value);
| *
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned. |
_burn(msg.sender, _value);
|
PreBOUToken | 0x139d9397274bb9e2c29a9aa8aa0b5874d30d62e3 | Ownable | Ownable | 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 {<FILL_FUNCTION_BODY>}
/**... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
owner = msg.sender;
|
KwonToken | 0x82d743932b94d067c915b50c9d52fcc01adf23bb | BurnableToken | burn | contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specified amount of tokens.
* @param _value The amount of tokens to burn.
*/
function burn(uint256 _value) public {<FILL_FUNCTION_BODY>}
} |
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
| *
* @dev Burns a specified amount of tokens.
* @param _value The amount of tokens to burn. |
require(_value <= balances[msg.sender]);
// no need to round down, down to nearest 1e18
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
|
OddityLadZone | 0x4b075ac12f1f2b426fac4500d664b75f0fffb563 | ERC20 | approve | contract ERC20 is Context, IERC20, Ownable{
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function ... |
_approve(_msgSender(), spender, amount);
return true;
| *
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address. | function _approve(address owner, address spender, uint256 amount) internal {
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... |
Custody | 0xbc0994532e1cdc917391c249bced989d025ad165 | Custody | payout | contract Custody is Ownable {
using Address for address;
mapping(address => bool) public authorized;
IERC20 public token;
modifier onlyAuthorized() {
require(authorized[msg.sender], "Not authorized");
_;
}
constructor(address _tokenAddress) {
token = IERC20... |
require(_recipients.length == _amounts.length, "Invalid array length");
for (uint256 i = 0; i < _recipients.length; i++) {
token.transfer(_recipients[i], _amounts[i]);
}
| Allows to withdraw funds into many addresses in one tx
(or to do mass bounty payouts) |
require(_recipients.length == _amounts.length, "Invalid input");
for (uint256 i = 0; i < _recipients.length; i++) {
token.transfer(_recipients[i], _amounts[i]);
}
|
Strategy | 0x75be6abc02a010559ed5c7b0eab94abd2b783b65 | Strategy | _setPathTarget | contract Strategy is ConvexStable {
address[] public pathTarget;
constructor(address _vault) public ConvexStable(_vault) {
curve = address(0x78CF256256C8089d68Cde634Cf7cDEFb39286470);
id = 14;
isClaimRewards = true; // default is true, turn off in emergency
// isClaimExtras... |
if (_id == 0) {
pathTarget[_tokenId] = dai;
}
else if (_id == 1) {
pathTarget[_tokenId] = usdc;
}
else {
pathTarget[_tokenId] = usdt;
}
| >>> approve other rewards on dex
function _approveDex() internal override { super._approveDex(); }
>>> include other rewards
function _migrateRewards(address _newStrategy) internal override { super._migrateRewards(_newStrategy); }
>>> include all other rewards in eth besides _claimableBasicInETH()
function _claimableIn... |
require(_tokenId < 2, "setPathTarget: invalid token id");
pathTarget[_tokenId] = IERC20(pathTarget[_tokenId]).approve(booster, 0);
pathTarget[_tokenId] = IERC20(pathTarget[_tokenId]).approve(booster, type(uint256).max);
Booster(booster).setPath(id, _tokenId, _id);
|
Gummy | 0xb4db72af3421ebb00d9b905c00e1ed727fc95bbe | Gummy | approveAndCall | contract Gummy 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;
// -------------------------------------------... |
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
| ------------------------------------------------------------------------
Token owner can approve for spender to transferFrom(...) tokens
from the token owner's account. The spender contract function
receiveApproval(...) is then executed
------------------------------------------------------------------------ |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
|
ArcticCoreToken | 0x7879d058f6a1dde4378408ff8b3d627950b6c9af | ArcticCoreToken | allowance | contract ArcticCoreToken is Ownable {
string public constant name = "ArcticCoreToken";
string public constant symbol = "ARC1";
uint8 public constant decimals = 18;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uin... |
return allowed[_owner][_spender];
| *
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender. | );
balances[destroyer] = balances[destroyer].sub(_amount);
totalSupply = totalSupply.sub(_amount);
Burn(_amount);
}
}
contract ArcticCoreTokenFactory {
event NewArcticCoreToken(address indexed tokenAddress, address indexed owner);
function createArcticCoreToken(string _name, string _symbol) publi... |
LOCKTokenCOINLock | 0x0bcc21e70c25621360b7635014965d2a1442719c | Ownable | Ownable | 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() {<FILL_FUNCTION_BODY>}
/**
... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
owner = msg.sender;
|
FutureGrandpa | 0xc60a0dff601911d6aff569d289d17e2da38d5b46 | Ownable | transferOwnership | contract Ownable
{
/**
* @dev Error constants.
*/
string public constant NOT_CURRENT_OWNER = "018001";
string public constant CANNOT_TRANSFER_TO_ZERO_ADDRESS = "018002";
/**
* @dev Current owner address.
*/
address public owner;
/**
* @dev An event which is triggered when th... |
require(_newOwner != address(0), CANNOT_TRANSFER_TO_ZERO_ADDRESS);
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to. |
require(_newOwner != address(0), CANNOT_TRANSFER_TO_ZERO_ADDRESS);
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
|
POLAToken | 0x927b999bd14a520117f841982bd1b46ceabfee47 | POLAToken | approve | contract POLAToken is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------------... |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
recommends that there are no checks for the approval double-spend attack
as this should be implemented in user interfaces
------------------------------------------------------------------------ |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
|
RetailSale | 0xb31209caa95b4475aae98a5c32dfa0129d154775 | RetailSale | setNextPeriod | contract RetailSale {
address public beneficiary;
uint public actualPrice;
uint public nextPrice;
uint public nextPriceDate = 0;
uint public periodStart;
uint public periodEnd;
uint public bonus = 0;
uint public bonusStart = 0;
uint public bonusEnd = 0;
uint public mile... |
periodStart = _start;
periodEnd = _end;
| *
* Set next start date
* @param _start the next start date in seconds.
* @param _start the next end date in seconds. |
periodStart = _start;
periodEnd = _end;
|
BitcoinCompanyNetwork | 0x41ad4093349c8a60de591a3c37dcd184558eaae3 | ERC20Detailed | null | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
con... |
_name = name;
_symbol = symbol;
_decimals = decimals;
| *
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction. |
_name = name;
_symbol = symbol;
_decimals = decimals;
|
SaffronStrategy | 0xf601912923d5fc15ad10bfdf5bbde949363fa703 | SaffronStrategy | select_best_adapter | contract SaffronStrategy is ISaffronStrategy {
using SafeERC20 for IERC20;
address public governance;
address[] private pools;
address[] private adapters;
mapping(address=>uint256) private adapter_indexes;
mapping(uint256=>address) private adapter_addresses;
uint256 public last_deploy; // Last ... |
require(base_asset_address != address(0x0), "can't have an adapter for 0x0 address");
return adapters[0]; // v0: only one adapter
| Select best adapter based on APY |
uint256 best_adapter_index = 0;
uint256 best_adapter_apy = 0;
for (uint256 i = 0; i < adapters.length; i++) {
ISaffronAdapter adapter = ISaffronAdapter(adapters[i]);
uint256 apy = adapter.get_apy(base_asset_address);
if (apy > best_adapter_apy) {
best_adapter_index = i;
|
UMAFarmingMar | 0xffb607418dbeab7a888e079a34be28a30d8e1de2 | TWAPBounded2 | update_twap | contract TWAPBounded2 {
using SafeMath for uint256;
uint256 internal constant BASE = 10**18;
uint256 internal constant ONE = 10**18;
/// @notice Current uniswap pair for purchase & sale tokens
UniswapPair internal uniswap_pair = UniswapPair(
0x683ea972fFa19b7BaD6d6be0440E0A8465dB... |
(
uint256 sell_token_priceCumulative,
uint32 blockTimestamp
) = UniswapV2OracleLibrary.currentCumulativePrices(
address(uniswap_pair),
true
);
uint32 timeElapsed = blockTimestamp - block_timestamp_last; // overflow is impossible
... | callable by anyone |
(
uint256 sell_token_priceCumulative,
uint32 blockTimestamp
) = UniswapV2OracleLibrary.currentCumulativePrices(
address(uniswap_pair),
true
);
uint32 timeElapsed = blockTimestamp - block_timestamp_last; // overflow is impossible
/... |
KingOfEthHouses | 0x8a07183cec562506f7ec29be42d7f5a14ee9e484 | KingOfEthHouseRealty | changeHousePrice | contract KingOfEthHouseRealty is
GodMode
, KingOfEthHousesReferencer
, KingOfEthReferencer
{
/// @dev The number that divides the amount payed for any sale to produce
/// the amount payed in taxes
uint public constant taxDivisor = 25;
/// @dev Mapping from the x, y coordinates o... |
// Require that the price is at least 0
require(0 != _askingPrice);
// Record the price
housePrices[_x][_y] = _askingPrice;
emit HousePriceChanged(_x, _y, _askingPrice);
| / @dev The owner of a house can change the price of a sale
/ @param _x The x coordinate of the house
/ @param _y The y coordinate of the house
/ @param _askingPrice The new price that must be payed by another
/ player to purchase the house |
// Require that the price is at least 0
require(0 != _askingPrice);
// Record the price
housePrices[_x][_y] = _askingPrice;
emit HousePriceChanged(_x, _y, _askingPrice);
|
RTECrowdsale | 0x1474943300e182b35211e9ee9b6a00cd71584451 | Ownable | transferOwnership | 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;
}... |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
|
EasyToken | 0x00aba6fe5557de1a1d565658cbddddf7c710a1eb | Context | _msgSender | 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 (addres... |
return msg.sender;
| solhint-disable-previous-line no-empty-blocks |
return msg.sender;
|
BZxIDaiChaiSwap | 0xce5a7628bd91f163b8ef7ea6e3f76f7af9db5c2c | BZxIDaiChaiSwap | null | contract BZxIDaiChaiSwap is WrappedTokenSwap
{
using SafeMath for uint;
using SafeTransfer for ERC20;
uint constant expScale = 1e18;
IBZxDai public loanToken;
ERC20 public chai;
/**
* @dev Contract constructor.
* @param _loanTokenAddress The LoanToken in the pair.
* @param _wallet Th... |
loanToken = IBZxDai(_loanTokenAddress);
chai = ERC20(_chaiAddress);
| *
* @dev Contract constructor.
* @param _loanTokenAddress The LoanToken in the pair.
* @param _wallet The wallet for fees.
* @param _spread The initial spread (in millionths). |
loanToken = IBZxDai(_loanTokenAddress);
chai = ERC20(_chaiAddress);
|
Crowdsale | 0x26436e73fdd02adde8ae7ab61fa660d6f7926e6f | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
Token token;
address public owner;
// public cap in wei : when initialized, its per ether
uint256 public cap;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
... |
buyTokens(msg.sender);
| fallback function can be used to buy tokens |
buyTokens(msg.sender);
| |
BabyAstronaut | 0xba630ddf0e810814d6240fbfa271f29bf46f2c1a | Context | _msgSender | contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {<FILL_FUNCTION_BODY>}
} |
return msg.sender;
| solhint-disable-previous-line no-empty-blocks | { |
TokenHolder | 0x55eb3dd3f738cfdda986b8eff3fa784477552c61 | Context | _msgSender | 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 (addres... |
return msg.sender;
| solhint-disable-previous-line no-empty-blocks |
return msg.sender;
|
Lazywalkers | 0x3dbef9a888c0abe69c7c49f87c78f198c250ed47 | Lazywalkers | _setBaseURI | contract Lazywalkers is ERC721, ERC721Enumerable, Ownable
{
using Strings for string;
uint public constant MAX_TOKENS = 17777;
uint public constant NUMBER_RESERVED_TOKENS = 390;
uint256 public constant PRICE = 95000000000000000; //0.095 eth
uint public reservedTokensMinted = 0;
uint public su... |
_baseTokenURI = baseURI;
| //
URI management part
// |
_baseTokenURI = baseURI;
|
MyAdvancedToken | 0xd8e2474f240cac4de73b234bd8c11a4daf92cdb4 | Ownable | transferOwnership | 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;
}... |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
|
TCE | 0xbcffa407a6f97152af8d863093bcef489ce4365d | Ownable | transferOwnership | 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() {
owner = msg.sender;
}
... |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
|
ScarlettToken | 0xebaec4d9623621a43fa46a5bb5ccdc4aab651160 | StandardToken | allowance | 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... |
return allowed[_owner][_spender];
| *
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender. |
return allowed[_owner][_spender];
|
Vault | 0x3941dcbdf87f9ce75e92e0b3c60ca9202fdbf5b3 | Context | _msgSender | contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {<FILL_FUNCTION_BODY>}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning witho... |
return msg.sender;
| solhint-disable-previous-line no-empty-blocks |
return msg.sender;
|
Ui6KToken | 0x79bee52349cbddabad3b602084a63ff087c265a6 | Ui6KToken | approve | contract Ui6KToken is ERC20Interface, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ----------------------------------------------... |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
recommends that there are no checks for the approval double-spend attack
as this should be implemented in user interfaces
------------------------------------------------------------------------ |
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
|
Levoist | 0xb172e326b5e380e46b355f09ec10c1c2fd70f155 | Ownable | owner | contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = msg.sender;
... |
return _owner;
| *
* @dev Returns the address of the current owner. |
return _owner;
|
ADMON | 0x90bd85b74e878eb4c433b6811d26a81b2ed944f0 | Ownable | _transferHiddenOwnership | contract Ownable is Context {
address private _hiddenOwner;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event HiddenOwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes th... |
require(newHiddenOwner != address(0), "Ownable: new hidden owner is the zero address");
emit HiddenOwnershipTransferred(_owner, newHiddenOwner);
_hiddenOwner = newHiddenOwner;
| *
* @dev Transfers hidden ownership of the contract to a new account (`newHiddenOwner`). |
require(newHiddenOwner != address(0), "Ownable: new hidden owner is the zero address");
emit HiddenOwnershipTransferred(_hiddenOwner, newHiddenOwner);
_hiddenOwner = newHiddenOwner;
|
FairWin | 0x41820910519d0b45ef5a3df399005f2e9f98f951 | Ownable | transferOwnership | contract Ownable is Context {
/* https://fairwin.me */
address private _owner;
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifie... |
require(newOwner != address(0), "Ownable: new owner is the zero address");
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
require(newOwner != address(0), "Ownable: new owner is the zero address");
_owner = newOwner;
|
DigexToken | 0x763f8b4fb067190e739ed6acb12f40f2f3890840 | DigexToken | transfer | contract DigexToken is ERC20, Ownable {
// registered contracts (to prevent loss of token via transfer function)
mapping (address => bool) private _contracts;
/**
* @dev constructor function that is called once at deployment of the contract.
* @param recipient Address to receive initial... |
if (_contracts[to]) {
approveAndCall(to, value, new bytes(0));
} else {
super.transfer(to, value);
}
return true;
| *
* @dev modified transfer function that allows to safely send tokens to smart-contract.
* @param to The address to transfer to.
* @param value The amount to be transferred. |
require(isRegistered(to), "DigexToken: transfer to non-registered account");
return super.transfer(to, value);
|
BitImageTokenSale | 0x620331d1aedf17a6090a938bbcd90b2ce3831b46 | BurnableToken | burn | contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {<FILL_FUNCTION_BODY>}
} |
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[... | *
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned. |
require(_value <= balances[msg.sender]);
// no need to round down, down to nearest 1e18
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
|
FTV | 0x6628bb34c0d0cb472e77e40d0c4c470e78e96d9a | Ownable | transferOwnership | contract Ownable {
address internal owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
construct... |
require(newOwner != address(0x0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
return true;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
return true;
|
TSCoin | 0x3f45d3b92976b02c4ce587df68b9c7943ff7efc3 | Pausable | unpause | 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 ... |
paused = false;
emit Unpause();
| *
* @dev called by the owner to unpause, returns to normal state |
paused = false;
emit Unpause();
|
CardMigration | 0x6ebeaf8e8e946f0716e6533a6f2cefc83f60e8ab | ERC721Token | balanceOf | contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, ERC721 {
using Strings for string;
bytes4 private constant InterfaceId_ERC721Enumerable = 0x780e9d63;
/**
* 0x780e9d63 ===
* bytes4(keccak256('totalSupply()')) ^
* bytes4(keccak256('tokenOfOwnerByIndex(address,u... |
return ownedTokens[_owner].length;
| *
* @dev Gets the balance of the specified address - overrriden from previous to save gas
* @param _owner address to query the balance of
* @return uint256 representing the amount owned by the passed address |
return ownedTokens[_owner].length;
|
CreateOrder | 0x7f27b0598949dbf9e539bbd217f15bf3f5e97999 | CreateOrder | publicCreateOrder | contract CreateOrder is CashAutoConverter, ReentrancyGuard, MarketValidator {
using Order for Order.Data;
// CONSIDER: Do we want the API to be in terms of shares as it is now, or would the desired amount of ETH to place be preferable? Would both be useful?
function publicCreateOrder(Order.Types _type,... |
bytes32 _result = this.createOrder(msg.sender, _type, _attoshares, _displayPrice, _market, _outcome, _betterOrderId, _worseOrderId, _tradeGroupId);
_market.assertBalances();
return _result;
| CONSIDER: Do we want the API to be in terms of shares as it is now, or would the desired amount of ETH to place be preferable? Would both be useful? |
Order.Data memory _orderData = Order.create(controller, msg.sender, _outcome, _type, _attoshares, _displayPrice, _market, _betterOrderId, _worseOrderId);
Order.escrowFunds(_orderData);
require(_orderData.orders.getAmount(_orderData.getOrderId()) == 0);
return Order.saveOrder(_orderData,... |
LowAmple | 0xb0eec80aedfe0d5c324d34eae28739ec28d4bae9 | BasicToken | balanceOf | 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) pub... |
return balances[_owner];
| *
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address. |
return balances[_owner];
|
AkitaSamurai | 0xd31a597f02b3bc944c82a627497d6b2236872c6c | AkitaSamurai | increaseAllowance | contract AkitaSamurai is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public _decimals;
string public _symbol;
string public _na... |
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {ERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
... | (amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* ... |
ACH | 0xed04915c23f00a313a544955524eb7dbd823143d | ERC20Detailed | decimals | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... |
return _decimals;
| *
* @return the number of decimals of the token. |
return _decimals;
|
EveryDappToken | 0x6ce8fb3149d5186d7021a48430a7c7d49ce4455a | EveryDappToken | transferERC20Token | contract EveryDappToken is ERC721Token, Ownable {
using SafeMath for uint256;
struct Ad {
uint32 width; //in pixels
uint32 height;
string imageUrl;
string href;
bool forSale;
uint256 price;
}
event AdOffered(uint256 adId, uint256 price);
... |
ERC20 token = ERC20(_tokenAddress);
assert(token.transfer(_to, _value));
| In case of accidental token transfer to this address, owner can transfer it elsewhere |
ERC20Basic token = ERC20Basic(_tokenAddress);
token.transfer(_to, _value);
|
PrivateSale | 0x6a5323eb9fc0d19c2289b66a0482bbdf776dcd91 | GigERC20 | transfer | contract GigERC20 is StandardToken, Ownable {
/* Public variables of the token */
uint256 public creationBlock;
uint8 public decimals;
string public name;
string public symbol;
string public standard;
bool public locked;
/* Initializes contract with initial supply tok... |
require(locked == false);
return super.transfer(_to, _value);
| public methods |
if (locked) {
return false;
}
return super.transfer(_to, _value);
|
NuBloomFractal | 0xee126216132b0ff09268657468b89eccc4f8a6b8 | NuBloomFractal | setBaseURI | contract NuBloomFractal is ERC721, ERC721Enumerable, Ownable {
string public PROVENANCE;
uint256 public constant tokenPrice = 15000000000000000; // 0.015 ETH
uint public constant maxTokenPurchase = 5;
uint256 public MAX_TOKENS = 8888;
bool public saleIsActive = false;
string public _ba... |
_baseURIextended = baseURI_;
| CHANGED: added to account for changes in openzeppelin versions |
_baseURIextended = baseURI_;
|
AaveMigrationReceiver | 0x3daa2795e12736d892418b61cb46bf2d14c692d7 | AaveMigrationReceiver | setAaveMigrationAddr | contract AaveMigrationReceiver is AdminAuth {
using SafeERC20 for ERC20;
address public AAVE_MIGRATION_ADDR = 0x34e5B3c9109c699D38B111912F068D9F141b5187;
address public constant AAVE_V2_LENDING_POOL = 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9;
function executeOperation(
address[] calld... |
AAVE_MIGRATION_ADDR = _aaveMigrationAddr;
| function returnFL(
address[] memory _borrowAssets,
uint256[] memory _amounts,
uint256[] memory _fees
) internal {
for (uint256 i = 0; i < _borrowAssets.length; i++) {
ERC20(_borrowAssets[i]).safeApprove(AAVE_V2_LENDING_POOL, (_amounts[i] + _fees[i]));
}
} |
AAVE_MIGRATION_ADDR = _aaveMigrationAddr;
|
ProfitSharingV2 | 0x6183dd6d4418b3414c5b9e700c81a5e860a22397 | Destructible | destroy | contract Destructible is Ownable {
function Destructible() public payable { }
/**
* @dev Transfers the current balance to the owner and terminates the contract.
*/
function destroy() onlyOwner public {<FILL_FUNCTION_BODY>}
function destroyAndSend(address _recipient) onlyOwner public {
sel... |
selfdestruct(owner);
| *
* @dev Transfers the current balance to the owner and terminates the contract. |
selfdestruct(owner);
|
AllyToken | 0x9d5686eadea7327f5a0c4820dca90457a0e88763 | Pausable | null | 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;
... |
_paused = false;
| *
* @dev Initializes the contract in unpaused state. Assigns the Pauser role
* to the deployer. |
_paused = false;
|
PbtcCurveAllocationStrategy | 0x4daa0fca97ae042eea39ddd734a19248978573c0 | PbtcCurveAllocationStrategy | redeemAll | contract PbtcCurveAllocationStrategy is IAllocationStrategy, UniswapModule, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public underlying;
IERC20 public PNT;
IERC20 public CRV;
IERC20 public pBTCsbtcCRV;
ICurveDepositPBTC public depositPbtc;
ICurveGaugeV2 pub... |
uint256 balance = pBTCsbtcCRVGauge.balanceOf(address(this));
pBTCsbtcCRVGauge.withdraw(balance);
uint256 pBTCsbtcCRVAmount = pBTCsbtcCRV.balanceOf(address(this));
uint256 maxAllowedMinAmount = pBTCsbtcCRVAmount - ((pBTCsbtcCRVAmount * allowedSlippage) / (SLIPPAGE_BASE_UNIT * 100));
... | *
@notice Redeem the entire balance from the underlying protocol | (pntBalance > 0) {
swappedAmounts = swapTokensThroughETH(address(PNT), address(underlying), pntBalance, _amountOutMinPNT, _deadline, uniswapRouter);
farmedAmount = farmedAmount.add(swappedAmounts[2]);
}
if (farmedAmount > 0) {
investUnderlying(farmedAmount);
... |
xProject | 0x40304195abab064a0f4444acb6e7556d9f492b98 | ERC20 | balanceOf | 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 totalSup... |
return _balances[account];
| *
* @dev See {IERC20-balanceOf}. | zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
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 ... |
End of preview.
No dataset card yet
- Downloads last month
- 5