Dataset Viewer
0
dict | 1
dict | 2
dict |
---|---|---|
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "Whenever ETH climbs past $3000, move 100 USDC to 0x1234567890abcdef1234567890abcdef12345678 on Ethereum. The ETH price is currently $3050.25, and the USDC contract address is 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);\n uint256 constant DECIMALS = 10**6;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceExceeds(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice > 3000 * PRICE_DECIMALS, \"ETH price must exceed $3000\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(usdc.balanceOf(address(this)) >= transferAmount, \"Insufficient USDC balance\");\n usdc.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "Should ETH dip below $2500, dispatch 50 DAI to 0x456789abcdef1234567890abcdef1234567890ab on Goerli. Current ETH price stands at $2400.75, with the DAI contract at 0x6B175474E89094C44Da98b954EedeAC495271d0F.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 dai = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);\n uint256 constant DECIMALS = 10**18;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceBelow(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice < 2500 * PRICE_DECIMALS, \"ETH price must be below $2500\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(dai.balanceOf(address(this)) >= transferAmount, \"Insufficient DAI balance\");\n dai.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "In the event that ETH hits exactly $3200, please transfer 200 USDC to 0x7890abcdef1234567890abcdef1234567890abcd on Ethereum. The ETH price is $3200.00 right now, and the USDC contract is 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);\n uint256 constant DECIMALS = 10**6;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceEquals(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice == 3200 * PRICE_DECIMALS, \"ETH price must equal $3200\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(usdc.balanceOf(address(this)) >= transferAmount, \"Insufficient USDC balance\");\n usdc.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "As long as ETH stays between $2800 and $2900, send 10 WETH to 0xabcdef1234567890abcdef1234567890abcdef12 on Kaleido Private Network. The current ETH price is $2850.50, and the WETH contract is 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 weth = IERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);\n uint256 constant DECIMALS = 10**18;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceInRange(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice >= 2800 * PRICE_DECIMALS, \"ETH price must be at least $2800\");\n require(ethPrice <= 2900 * PRICE_DECIMALS, \"ETH price must be at most $2900\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(weth.balanceOf(address(this)) >= transferAmount, \"Insufficient WETH balance\");\n weth.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "Once ETH surpasses $3000, attempt to transfer 0 USDC to 0x1234567890abcdef1234567890abcdef12345678 on Ethereum. The ETH price is $3050.25 currently, and the USDC contract is at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);\n uint256 constant DECIMALS = 10**6;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceExceeds(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice > 3000 * PRICE_DECIMALS, \"ETH price must exceed $3000\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(usdc.balanceOf(address(this)) >= transferAmount, \"Insufficient USDC balance\");\n usdc.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
{
"content": "You are an assistant specialized in generating Solidity smart contract code for DeFi operations.",
"role": "system"
} | {
"content": "Provided ETH falls under $2500, shift 100 DAI to 0x0000000000000000000000000000000000000000 on Goerli. The ETH price is at $2400.75, and the DAI contract address is 0x6B175474E89094C44Da98b954EedeAC495271d0F.",
"role": "user"
} | {
"content": "pragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract TokenTransfer {\n IERC20 dai = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F);\n uint256 constant DECIMALS = 10**18;\n uint256 constant PRICE_DECIMALS = 10**8;\n\n function transferIfPriceBelow(uint256 ethPrice, uint256 amount, address recipient) external {\n require(ethPrice < 2500 * PRICE_DECIMALS, \"ETH price must be below $2500\");\n require(amount > 0, \"Amount must be greater than zero\");\n require(recipient != address(0), \"Invalid recipient address\");\n uint256 transferAmount = amount * DECIMALS;\n require(dai.balanceOf(address(this)) >= transferAmount, \"Insufficient DAI balance\");\n dai.transfer(recipient, transferAmount);\n }\n}",
"role": "assistant"
} |
README.md exists but content is empty.
- Downloads last month
- 92