This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query":"generate an ERC 721 contract which allow minting but not transferring tokens.", | |
"response":"Source: openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol\nContent: // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.20; import {ERC721} from \"../ERC721.sol\"; import {Pausable} from \"../../../utils/Pausable.sol\"; /** * @dev ERC-721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * IMPORTANT: This contract does not include public pause and unpause functions. In * addition to inheriting this contract, you must define both functions, invoking the * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. No |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace with your actual API key and agent ID | |
const API_KEY = 'mRU8ku8wCiVYm1aDQWW6tnfsWY7qu0jm'; | |
const AGENT_ID = 'ag:90ac4fd0:20250208:untitled-agent:3cb5361b'; | |
const API_URL = 'https://api.mistral.ai/v1/agents/completions'; | |
// Function to call the Mistral AI endpoint | |
export async function callMistralAI(messages) { | |
try { | |
const response = await fetch(API_URL, { | |
method: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace with your actual API key and agent ID | |
const API_KEY = 'mRU8ku8wCiVYm1aDQWW6tnfsWY7qu0jm'; | |
const AGENT_ID = 'ag:90ac4fd0:20250208:untitled-agent:3cb5361b'; | |
const API_URL = 'https://api.mistral.ai/v1/agents/completions'; | |
// Function to call the Mistral AI endpoint | |
export async function callMistralAI(messages) { | |
try { | |
const response = await fetch(API_URL, { | |
method: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace with your actual API key and agent ID | |
const API_KEY = 'mRU8ku8wCiVYm1aDQWW6tnfsWY7qu0jm'; | |
const AGENT_ID = 'ag:90ac4fd0:20250208:untitled-agent:3cb5361b'; | |
const API_URL = 'https://api.mistral.ai/v1/agents/completions'; | |
// Function to call the Mistral AI endpoint | |
export async function callMistralAI(messages) { | |
try { | |
const response = await fetch(API_URL, { | |
method: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ethers from "ethers"; | |
import {Provider, Contract, utils, Signer, BrowserProvider, Wallet} from "zksync-ethers"; | |
// Address of the ZeekMessages contract | |
const GREETER_CONTRACT_ADDRESS = "0x2f5Fa95a28EEd40DD80ED3fFC718094EB41253b4"; | |
// Address of the ERC20 token contract | |
const TOKEN_CONTRACT_ADDRESS = "0xF4dF2c515581A9fA5bAa078d04703c0f3Fd9115a"; | |
// Message to be sent to the contract | |
const NEW_MESSAGE = "This tx cost me no ETH!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma version >0.3.10 | |
# Blind Auction. Adapted to Vyper from [Solidity by Example](https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst#blind-auction-1) | |
struct Bid: | |
blindedBid: bytes32 | |
deposit: uint256 | |
gg | |
# Note: because Vyper does not allow for dynamic arrays, we have limited the | |
# number of bids that can be placed by one address to 128 in this example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest": "ethpm/3", | |
"name": null, | |
"version": null, | |
"meta": null, | |
"sources": { | |
"examples/factory/Exchange.vy": { | |
"urls": [], | |
"checksum": null, | |
"content": "#pragma version >0.3.10\n\nfrom ethereum.ercs import IERC20\n\n\ninterface Factory:\n def register(): nonpayable\n\n\ntoken: public(IERC20)\nfactory: Factory\n\n\n@deploy\ndef __init__(_token: IERC20, _factory: Factory):\n self.token = _token\n self.factory = _factory\n\n\n@external\ndef initialize():\n # Anyone can safely call this function because of EXTCODEHASH\n extcall self.factory.register()\n\n\n# NOTE: This contract restricts trading to only be done by the factory.\n# A practical implementation would probably want counter-pairs\n# and liquidity management features for each exchange pool.\n\n\n@external\ndef receive(_from: address, _amt: uint256):\n assert msg.sender == self.factory.address\n success: bool = extcall self.token.transferFrom(_from, self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts | |
*/ | |
contract Storage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts | |
*/ | |
contract Storage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line @typescript-eslint/no-var-requires | |
const snarkjs = require('snarkjs'); | |
const logger = { | |
info: (...args) => console.log(...args), | |
debug: (...args) => console.log(...args) | |
}; | |
(async () => { | |
try { |
NewerOlder