instruction stringlengths 4 2.21k | input stringlengths 0 96.8k | output stringlengths 0 155k | source stringclasses 60
values | type stringclasses 7
values | vuln_type stringclasses 65
values |
|---|---|---|---|---|---|
Implement an ERC20 token with fee-on-transfer mechanism. | /*
*
* nGAS: GASPump Station (Farming protocol)
* Website: https://pumpgasplatform.com/
*
* Driller contract
*/
pragma solidity ^0.6.12;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
*... | DISL | production_code | null | |
Make a smart contract to create and distribute a token called Testary. The smart contract allows for the minting of tokens during a specific period of time. The token is created using the MintableToken contract and inherits the functions from the StandardToken and Ownable contracts. The token is called Testary (symbol:... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to implement an ERC20 token called "UniswapExchange". The purpose of this smart contract is to create and manage a custom token that can be transferred, approved, and burned. It provides functions to transfer tokens between addresses, check the token balance of an address, approve another address ... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create a token called "SEXYWORF" with the symbol "TREKINU". The contract should implement the ERC20 standard and provide basic functionalities such as transferring tokens, checking balances, and approving token allowances. The contract should also include a maximum transaction amount that can b... | smart-contracts-instructions | code_generation | null | ||
Implement an NFT collection with whitelist minting. | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "contracts/ERC721Enumerable.sol";
import "contracts/Ownable.sol";
import "contracts/Strings.sol";
import "contracts/Counters.sol";
import "contracts/SafeMath.sol";
contract TheMiningBee is ERC721Enumerable, Ownable {
/*
*/
//uint256's
uint... | DISL | production_code | null | |
Make a smart contract to retrieve metadata and underlying token rates for a given token. The purpose of this smart contract is to provide a standardized interface for retrieving information about ERC20-style tokens and their underlying components. | smart-contracts-instructions | code_generation | null | ||
Write an exploit contract that attacks Zenterest using reentrancy. Include setup and attack functions. | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import "forge-std/Test.sol";
import "../interface.sol";
// TX : https://etherscan.io/tx/0xfe8bc757d87e97a5471378c90d390df47e1b29bb9fca918b94acd8ecfaadc598
// Profit : ~ 21000 USD
// REASON : Price Out Of Date
contract ContractTest is Test {
address ... | DeFiHackLabs | exploit_poc | reentrancy | |
Write an ERC4626 vault with yield strategy. | /**
* Copyright 2017–2018, bZeroX, LLC. All Rights Reserved.
* Adapted from MultiSigWalletWithTimeLock.sol, Copyright 2017 ZeroEx Intl.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.4.24;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before ... | DISL | production_code | null | |
Make a smart contract to create a BEP20 token called NyanDoge with a total supply of 1000000000000000 and transfer, approve, and transferFrom functions. The contract also allows for ownership transfer and includes a function to clear the contract balance. The token contract uses SafeMath library to prevent overflow and... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create and manage a token called HKDCToken. The contract allows for the transfer of tokens between addresses and keeps track of the token balances of each address. The contract also includes a feature to freeze accounts and an ability to mint new tokens. Additionally, the contract includes an o... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create an ERC721 NFT collection called "MultiChainChads", with a maximum supply of 10,000 tokens and a maximum mint amount of 100 tokens per transaction. The contract should have a cost of 0.05 ether per token, and the ability to pause and unpause minting. The contract should also have a reveal... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to retrieve the balance of xRoo staking tokens for a given account. The purpose of this smart contract is to provide a simple and read-only interface to query the staked balance of the xRoo staking tokens for a specific user account, without the ability to modify or transfer any tokens. | smart-contracts-instructions | code_generation | null | ||
Implement a Solidity test case that reproduces the Ara hack from 2023-06. Focus on flash loan. | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import "forge-std/Test.sol";
import "./../interface.sol";
// @KeyInfo - Total Lost : ~125K USD$
// Attacker : https://bscscan.com/address/0xf84efa8a9f7e68855cf17eaac9c2f97a9d131366
// Attack Contract : https://bscscan.com/address/0x98e241bd3be918e0d927af... | DeFiHackLabs | exploit_poc | flash loan | |
Write a complete ERC20 token with mint, burn, and permit functions. | pragma solidity 0.8.6;
// MasterChef is the master of Token. He can make Token and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once Token is sufficiently
// distributed and the community can show t... | DISL | production_code | null | |
Write an ERC721 NFT contract with metadata and royalties. | pragma solidity 0.8.1;
contract BitDog is ERC721Enumerable, Ownable {
struct DocSpecs {
uint8 bodyShape; // 0 basic, 1 inverted, 2 thin
uint8 ears; // 0 standing, 1 resting
uint8 tounge; // 0 straight, 1 left, 2 right
uint8 item;
uint8[3] mainColor;
uint... | DISL | production_code | null | |
Create a flash loan attack that exploits this protocol's logic flaw. | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
import "forge-std/Test.sol";
import "./../interface.sol";
// import "./utils.sol";
interface IEthCrossChainManager {
function verifyHeaderAndExecuteTx(
bytes memory proof,
bytes memory rawHeader,
bytes memory headerProof,
... | DeFiHackLabs_augmented | exploit_poc | null | |
Analyze this exploit code and explain the reentrancy vulnerability it targets. | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import "forge-std/Test.sol";
import "../interface.sol";
// reason : price manipulation,mintv2 use wbnb-usdt pair price to mint Token
// guy : https://x.com/TenArmorAlert/status/1844241843518951451
// tx : https://app.blocksec.com/explorer/tx/bsc/0... | This exploit targets a reentrancy vulnerability.
Attack Flow:
1. The attacker first sets up the attack contract
2. Then triggers the vulnerable function
3. Exploits the flaw to extract value
4. Profits from the attack
Mitigation: Use proper checks, reentrancy guards, and access controls. | vuln_analysis | audit | null |
Check this contract for integer overflow/underflow issues. | // SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import {DataStore} from "../data/DataStore.sol";
import {Keys} from "../data/Keys.sol";
import {Errors} from "../error/Errors.sol";
import {EventEmitter} from "../event/EventEmitter.sol";
import {Precision} from "../utils/Precision.sol";
import {Market} fro... | ## Security Audit
### Contract Type: Token
### Findings:
1. Access Control - Verify all admin functions have proper modifiers
2. Reentrancy - Check external calls follow checks-effects-interactions
3. Input Validation - Ensure all parameters are validated
### Risk Assessment: LOW-MEDIUM | generated_audit | audit | null |
Write a production-quality smart contract following best practices. | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library EncodingUtils {
string internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "... | DISL | production_code | null | |
Analyze this smart contract and identify the dataset vulnerability at the marked lines. | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 38
*/
pragma solidity ^0.4.19;
contract PrivateBank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function PrivateBank(address _lib)
{
TransferLog = Log... | This contract contains a dataset vulnerability. The vulnerable lines are marked with '// <yes> <report>'. Review the code carefully for the vulnerability pattern. | SmartBugs | audit | dataset |
Make a smart contract to create a token called "Pornhub" with the symbol "PORNH". The contract should allow users to transfer tokens to other addresses and approve spending limits for other addresses. The total supply of tokens is set to 100,000,000 with 18 decimal places. The contract should also include functions to ... | smart-contracts-instructions | code_generation | null | ||
Write a production-quality smart contract following best practices. | pragma solidity ^0.6.0;
import "../implementation/FixedPoint.sol";
// Wraps the FixedPoint library for testing purposes.
contract FixedPointTest {
using FixedPoint for FixedPoint.Unsigned;
using FixedPoint for uint256;
using SafeMath for uint256;
function wrapFromUnscaledUint(uint256 a) external pur... | DISL | production_code | null | |
Make a smart contract to create a decentralized token called "MetaFreelance" (named "MetaFree" with symbol) with a total supply of 1,000,000 tokens. The contract allows users to transfer tokens, approve and transfer tokens on behalf of another address, and view their token balance. It includes functionalities such as a... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to distribute a custom token called "LongLegs" (symbol: XLL) to multiple addresses. The contract should allow the owner to freeze specific accounts and lockup certain addresses until a specified UNIX time. It should also provide the ability to burn tokens, mint new tokens, and finish minting. Addi... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create Space Inu Token, a cryptocurrency with an initial supply of 1 billion tokens and a fixed tax fee of 8%. The contract should allow for buying and selling of the token on the Uniswap exchange, with liquidity added automatically upon opening of trading. The contract should also include a ma... | smart-contracts-instructions | code_generation | null | ||
Implement an ERC20 token with fee-on-transfer mechanism. | contract Strategy is CurveVoterProxy {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public constant pool = address(0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA);
address public constant lqty = address(0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D);
... | DISL | production_code | null | |
Make a smart contract to act as a proxy for other smart contracts, allowing for the delegation of function calls and payments. The contract has functionalities to set and get the target address of the smart contract whose functionalities will be delegated, as well as set and get the owner of the proxy contract. The con... | smart-contracts-instructions | code_generation | null | ||
Implement a multi-strategy vault. | // SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <council@enzyme.finance>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
import "../../core/fund/comptroller/Comp... | DISL | production_code | null | |
Write a complete ERC20 token with mint, burn, and permit functions. | pragma solidity >=0.4.21 <0.6.0;
contract ApproveAndCallFallBack {
function receiveApproval(
address from,
uint256 _amount,
address _token,
bytes memory _data
) public;
}
contract TransferEventCallBack{
function onTransfer(address _from, address _to, uint256 _amou... | DISL | production_code | null | |
Make a smart contract to implement a token based on the ERC20 standard named "ThreeDimensional" with symbol "TD". The token should have a supply of 10,000,000,000,000. The smart contract should support basic token transfer functionality, including transferring tokens between accounts and checking token balances. The to... | smart-contracts-instructions | code_generation | null | ||
Create a pausable ERC20 token with blacklist functionality. | pragma solidity ^0.4.26;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner... | DISL | production_code | null | |
Implement an NFT collection with whitelist minting. | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
contract MasksOfEther is ERC721, ERC721Enumerable, Ownable {
using SafeMath for uint256;
uint256 private price = 0.08 ether;
uin... | DISL | production_code | null | |
Make a smart contract to create a cryptocurrency token called "Grichka Inu" with the symbol "Grichka-Inu". The purpose of the smart contract is to allow users to transfer the token between addresses, approve other addresses to spend the token, and check the balance of the token in an address. The smart contract also in... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to mint and sell BONEY APE CLUB NFTs with a maximum supply of 5000. The NFTs should be ERC721 compliant and implement the IERC2981 royalty standard. There should be a public sale for the NFTs, with a set price of 0.01 ether per NFT, and an option for users to mint up to 10 NFTs per transaction. Th... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create a token called "LongChain" with the symbol "Long". The purpose of the smart contract is to allow token transfers between accounts, provide an allowance system for approved spending, and allow the contract owner to transfer ownership. The total supply of the token is 150 million with 18 d... | smart-contracts-instructions | code_generation | null | ||
Make a smart contract to create a token called "Popo Inu" with the symbol "POPO". The purpose of the smart contract is to enable the trading and transfer of the token. It includes features such as a 25% tax on sellers who sell within 24 hours, an 8% tax on regular sellers, and a 1% tax on transfers. The contract also i... | smart-contracts-instructions | code_generation | null |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 7