This file contains hidden or 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: MIT | |
| // OpenZeppelin Contracts (last updated v5.4.0) (governance/utils/IVotes.sol) | |
| pragma solidity >=0.8.4; | |
| /** | |
| * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. | |
| */ | |
| interface IVotes { | |
| /** | |
| * @dev The signature used has expired. |
This file contains hidden or 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: MIT | |
| pragma solidity >=0.4.22 <0.9.0; | |
| library console { | |
| address constant CONSOLE_ADDRESS = | |
| 0x000000000000000000636F6e736F6c652e6c6f67; | |
| function _sendLogPayloadImplementation(bytes memory payload) internal view { | |
| address consoleAddress = CONSOLE_ADDRESS; | |
| /// @solidity memory-safe-assembly |
This file contains hidden or 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 Create a Voting contract", | |
| "response":"Source: openzeppelin-contracts/contracts/mocks/VotesMock.sol\nContent: // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {Votes} from \"../governance/utils/Votes.sol\"; abstract contract VotesMock is Votes { mapping(address voter => uint256) private _votingUnits; function getTotalSupply() public view returns (uint256) { return _getTotalSupply(); } function delegate(address account, address newDelegation) public { return _delegate(account, newDelegation); } function _getVotingUnits(address account) internal view override returns (uint256) { return _votingUnits[account]; } function _mint(address account, uint256 votes) internal { _votingUnits[account] += votes; _transferVotingUnits(address(0), account, votes); } function _burn(address account, uint256 votes) internal { _votingUnits[account] += votes; _transferVotingUnits(account, address(0), votes); } } abstract contract VotesTimestampMock is VotesMock { function clock() public view |
This file contains hidden or 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 { Sdk } from '@circles-sdk/sdk' | |
| import { BrowserProviderContractRunner } from "@circles-sdk/adapter-ethers" | |
| import { cidV0ToUint8Array } from '@circles-sdk/utils' | |
| import { ethers } from 'ethers' | |
| import type {CirclesConfig} from "@circles-sdk/sdk"; | |
| export const circlesConfig: CirclesConfig = { | |
| circlesRpcUrl: 'https://static.94.138.251.148.clients.your-server.de/rpc/', | |
| pathfinderUrl: 'https://pathfinder.aboutcircles.com', |
This file contains hidden or 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 { deploy } from './ethers-lib' | |
| (async () => { | |
| try { | |
| const accountWithToken = '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4' | |
| const accountNullBalance = '0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2' | |
| let erc20 = await deploy('MyToken', ['0x5B38Da6a701c568545dCfcB03FcB875f56beddC4']) | |
| console.log(`MyToken address: ${erc20.address}`) | |
| const sender = await deploy('Sender', [erc20.address]) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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!"; |
NewerOlder