From 24d7f5e8ad2390bfcbd911ac94e67b728c5388f3 Mon Sep 17 00:00:00 2001 From: enitrat Date: Sun, 17 Nov 2024 14:30:23 +0700 Subject: [PATCH] feat: starknet token transfer --- .../plugin-solana/src/actions/transfer.ts | 4 +- packages/plugin-starknet/package.json | 2 +- .../plugin-starknet/src/actions/transfer.ts | 48 +- packages/plugin-starknet/src/index.ts | 9 +- .../plugin-starknet/src/utils/ERC20Token.ts | 59 + packages/plugin-starknet/src/utils/erc20.json | 1030 +++++++++++++++++ pnpm-lock.yaml | 42 +- 7 files changed, 1147 insertions(+), 47 deletions(-) create mode 100644 packages/plugin-starknet/src/utils/ERC20Token.ts diff --git a/packages/plugin-solana/src/actions/transfer.ts b/packages/plugin-solana/src/actions/transfer.ts index d88c3a45..c5fe7774 100644 --- a/packages/plugin-solana/src/actions/transfer.ts +++ b/packages/plugin-solana/src/actions/transfer.ts @@ -80,9 +80,9 @@ export default { /* const adminIds = runtime.getSetting("ADMIN_USER_IDS")?.split(",") || []; //console.log("Admin IDs from settings:", adminIds); - + const isAdmin = adminIds.includes(message.userId); - + if (isAdmin) { //console.log(`Authorized transfer from user: ${message.userId}`); return true; diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json index 9cdc6b18..b5703515 100644 --- a/packages/plugin-starknet/package.json +++ b/packages/plugin-starknet/package.json @@ -8,7 +8,7 @@ "@ai16z/eliza": "workspace:*", "@ai16z/plugin-trustdb": "workspace:*", "@avnu/avnu-sdk": "^2.1.1", - "starknet": "^6.11.0", + "starknet": "^6.17.0", "tsup": "^8.3.5", "vitest": "^2.1.4" }, diff --git a/packages/plugin-starknet/src/actions/transfer.ts b/packages/plugin-starknet/src/actions/transfer.ts index 181f3a44..c0760ed1 100644 --- a/packages/plugin-starknet/src/actions/transfer.ts +++ b/packages/plugin-starknet/src/actions/transfer.ts @@ -14,7 +14,12 @@ import { composeContext, generateObject, } from "@ai16z/eliza"; -import { validateSettings } from "../utils"; +import { getStarknetAccount, validateSettings } from "../utils"; +import { Account, RpcProvider } from "starknet"; +import { PROVIDER_CONFIG } from ".."; +import path from "path"; +import fs from "fs"; +import { ERC20Token } from "../utils/ERC20Token"; export interface TransferContent extends Content { tokenAddress: string; @@ -27,12 +32,24 @@ function isTransferContent( content: TransferContent ): content is TransferContent { console.log("Content for transfer", content); - return ( + const validTypes = ( typeof content.tokenAddress === "string" && typeof content.recipient === "string" && (typeof content.amount === "string" || typeof content.amount === "number") ); + if (!validTypes) { + return false; + } + + // Addresses must be 32-bytes long with a 0x prefix + const validAddresses = ( + content.tokenAddress.startsWith("0x") && + content.tokenAddress.length === 66 && + content.recipient.startsWith("0x") && + content.recipient.length === 66 + ); + return validTypes && validAddresses; } const transferTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. @@ -40,9 +57,9 @@ const transferTemplate = `Respond with a JSON markdown block containing only the Example response: \`\`\`json { - "tokenAddress": "BieefG47jAHCGZBxi2q87RDuHyGZyYC3vAzxpyu8pump", - "recipient": "9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa", - "amount": "1000" + "tokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + "recipient": "0x1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF", + "amount": "0.001" } \`\`\` @@ -110,9 +127,20 @@ export default { } try { + const account = getStarknetAccount(runtime); + const erc20Token = new ERC20Token(content.tokenAddress, account); + const decimals = await erc20Token.decimals(); + const amountWei = BigInt(content.amount) * 10n ** BigInt(decimals); + const transferCall = erc20Token.transferCall(content.recipient, amountWei); + + console.log("Transferring", amountWei, "of", content.tokenAddress, "to", content.recipient); + + const tx = await account.execute(transferCall); + + console.log("Transfer completed successfully! tx: " + tx.transaction_hash); if (callback) { callback({ - text: `Successfully`, + text: "Transfer completed successfully! tx: " + tx.transaction_hash, content: {}, }); } @@ -135,7 +163,13 @@ export default { { user: "{{user1}}", content: { - text: "Send 69 STRK to 0x1234567890123456789012345678901234567890", + text: "Send 69 STRK to 0x1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF", + }, + }, + { + user: "{{user2}}", + content: { + text: "Transfer to 0x1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF 0.01 ETH", }, }, ], diff --git a/packages/plugin-starknet/src/index.ts b/packages/plugin-starknet/src/index.ts index 73a3747a..f79c46d7 100644 --- a/packages/plugin-starknet/src/index.ts +++ b/packages/plugin-starknet/src/index.ts @@ -5,12 +5,11 @@ export const PROVIDER_CONFIG = { AVNU_API: "https://starknet.impulse.avnu.fi/v1", MAX_RETRIES: 3, RETRY_DELAY: 2000, - DEFAULT_RPC: "https://api.mainnet-beta.solana.com", + DEFAULT_RPC: "https://free-rpc.nethermind.io/mainnet-juno/", TOKEN_ADDRESSES: { - SOL: "", - BTC: "", - ETH: "", - STRK: "", + BTC: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac", + ETH: "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + STRK: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", }, TOKEN_SECURITY_ENDPOINT: "/defi/token_security?address=", TOKEN_TRADE_DATA_ENDPOINT: "/defi/v3/token/trade-data/single?address=", diff --git a/packages/plugin-starknet/src/utils/ERC20Token.ts b/packages/plugin-starknet/src/utils/ERC20Token.ts new file mode 100644 index 00000000..4313d7fa --- /dev/null +++ b/packages/plugin-starknet/src/utils/ERC20Token.ts @@ -0,0 +1,59 @@ +import path from "path"; +import fs from "fs"; +import { Account, Call, CallData, Calldata, Contract, cairo } from "starknet"; + +export type ApproveCall = { + contractAddress: string; + entrypoint: "approve"; + calldata: Calldata; +}; + +export type TransferCall = { + contractAddress: string; + entrypoint: "transfer"; + calldata: Calldata; +}; + +export class ERC20Token { + abi: any; + contract: Contract; + calldata: CallData; + constructor(token: string, account?: Account) { + const erc20AbiPath = path.join(__dirname, "../utils/erc20.json"); + const erc20Abi = JSON.parse(fs.readFileSync(erc20AbiPath, "utf8")); + this.contract = new Contract(erc20Abi, token, account); + this.calldata = new CallData(this.contract.abi); + } + + public address() { + return this.contract.address; + } + + public async decimals() { + const result = await this.contract.call("decimals"); + return result as bigint; + } + + + public approveCall(spender: string, amount: bigint): ApproveCall { + return { + contractAddress: this.contract.address, + entrypoint: "approve", + calldata: this.calldata.compile("approve", { + spender: spender, + amount: cairo.uint256(amount), + }), + }; + } + + public transferCall(recipient: string, amount: bigint): TransferCall { + return { + contractAddress: this.contract.address, + entrypoint: "transfer", + calldata: this.calldata.compile("transfer", { + recipient: recipient, + amount: cairo.uint256(amount), + }), + }; + } +} diff --git a/packages/plugin-starknet/src/utils/erc20.json b/packages/plugin-starknet/src/utils/erc20.json index e69de29b..21e307bc 100644 --- a/packages/plugin-starknet/src/utils/erc20.json +++ b/packages/plugin-starknet/src/utils/erc20.json @@ -0,0 +1,1030 @@ +[ + + { + "name": "MintableToken", + "type": "impl", + "interface_name": "src::mintable_token_interface::IMintableToken" + }, + { + "name": "core::integer::u256", + "type": "struct", + "members": [ + { + "name": "low", + "type": "core::integer::u128" + }, + { + "name": "high", + "type": "core::integer::u128" + } + ] + }, + { + "name": "src::mintable_token_interface::IMintableToken", + "type": "interface", + "items": [ + { + "name": "permissioned_mint", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "permissioned_burn", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "MintableTokenCamelImpl", + "type": "impl", + "interface_name": "src::mintable_token_interface::IMintableTokenCamel" + }, + { + "name": "src::mintable_token_interface::IMintableTokenCamel", + "type": "interface", + "items": [ + { + "name": "permissionedMint", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "permissionedBurn", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "Replaceable", + "type": "impl", + "interface_name": "src::replaceability_interface::IReplaceable" + }, + { + "name": "core::array::Span::", + "type": "struct", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "name": "src::replaceability_interface::EICData", + "type": "struct", + "members": [ + { + "name": "eic_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "eic_init_data", + "type": "core::array::Span::" + } + ] + }, + { + "name": "core::option::Option::", + "type": "enum", + "variants": [ + { + "name": "Some", + "type": "src::replaceability_interface::EICData" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "name": "core::bool", + "type": "enum", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "name": "src::replaceability_interface::ImplementationData", + "type": "struct", + "members": [ + { + "name": "impl_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "eic_data", + "type": "core::option::Option::" + }, + { + "name": "final", + "type": "core::bool" + } + ] + }, + { + "name": "src::replaceability_interface::IReplaceable", + "type": "interface", + "items": [ + { + "name": "get_upgrade_delay", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "name": "get_impl_activation_time", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "name": "add_new_implementation", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_implementation", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "replace_to", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "AccessControlImplExternal", + "type": "impl", + "interface_name": "src::access_control_interface::IAccessControl" + }, + { + "name": "src::access_control_interface::IAccessControl", + "type": "interface", + "items": [ + { + "name": "has_role", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + }, + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "get_role_admin", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "name": "RolesImpl", + "type": "impl", + "interface_name": "src::roles_interface::IMinimalRoles" + }, + { + "name": "src::roles_interface::IMinimalRoles", + "type": "interface", + "items": [ + { + "name": "is_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "is_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "register_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "register_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "renounce", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "ERC20Impl", + "type": "impl", + "interface_name": "openzeppelin::token::erc20::interface::IERC20" + }, + { + "name": "openzeppelin::token::erc20::interface::IERC20", + "type": "interface", + "items": [ + { + "name": "name", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "name": "symbol", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "name": "decimals", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "name": "total_supply", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "balance_of", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "allowance", + "type": "function", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "transfer", + "type": "function", + "inputs": [ + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "transfer_from", + "type": "function", + "inputs": [ + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "approve", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + } + ] + }, + { + "name": "ERC20CamelOnlyImpl", + "type": "impl", + "interface_name": "openzeppelin::token::erc20::interface::IERC20CamelOnly" + }, + { + "name": "openzeppelin::token::erc20::interface::IERC20CamelOnly", + "type": "interface", + "items": [ + { + "name": "totalSupply", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "balanceOf", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "transferFrom", + "type": "function", + "inputs": [ + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + } + ] + }, + { + "name": "constructor", + "type": "constructor", + "inputs": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "symbol", + "type": "core::felt252" + }, + { + "name": "decimals", + "type": "core::integer::u8" + }, + { + "name": "initial_supply", + "type": "core::integer::u256" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permitted_minter", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "provisional_governance_admin", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "upgrade_delay", + "type": "core::integer::u64" + } + ] + }, + { + "name": "increase_allowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "added_value", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "decrease_allowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "subtracted_value", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "increaseAllowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "addedValue", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "decreaseAllowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "subtractedValue", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "kind": "struct", + "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Transfer", + "type": "event", + "members": [ + { + "kind": "data", + "name": "from", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "to", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "value", + "type": "core::integer::u256" + } + ] + }, + { + "kind": "struct", + "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Approval", + "type": "event", + "members": [ + { + "kind": "data", + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "value", + "type": "core::integer::u256" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationReplaced", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationFinalized", + "type": "event", + "members": [ + { + "kind": "data", + "name": "impl_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleGranted", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleRevoked", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleAdminChanged", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "previous_admin_role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "new_admin_role", + "type": "core::felt252" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::GovernanceAdminAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "added_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "added_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::GovernanceAdminRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "removed_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "removed_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::UpgradeGovernorAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "added_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "added_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::UpgradeGovernorRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "removed_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "removed_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "enum", + "name": "openzeppelin::token::erc20_v070::erc20::ERC20::Event", + "type": "event", + "variants": [ + { + "kind": "nested", + "name": "Transfer", + "type": "openzeppelin::token::erc20_v070::erc20::ERC20::Transfer" + }, + { + "kind": "nested", + "name": "Approval", + "type": "openzeppelin::token::erc20_v070::erc20::ERC20::Approval" + }, + { + "kind": "nested", + "name": "ImplementationAdded", + "type": "src::replaceability_interface::ImplementationAdded" + }, + { + "kind": "nested", + "name": "ImplementationRemoved", + "type": "src::replaceability_interface::ImplementationRemoved" + }, + { + "kind": "nested", + "name": "ImplementationReplaced", + "type": "src::replaceability_interface::ImplementationReplaced" + }, + { + "kind": "nested", + "name": "ImplementationFinalized", + "type": "src::replaceability_interface::ImplementationFinalized" + }, + { + "kind": "nested", + "name": "RoleGranted", + "type": "src::access_control_interface::RoleGranted" + }, + { + "kind": "nested", + "name": "RoleRevoked", + "type": "src::access_control_interface::RoleRevoked" + }, + { + "kind": "nested", + "name": "RoleAdminChanged", + "type": "src::access_control_interface::RoleAdminChanged" + }, + { + "kind": "nested", + "name": "GovernanceAdminAdded", + "type": "src::roles_interface::GovernanceAdminAdded" + }, + { + "kind": "nested", + "name": "GovernanceAdminRemoved", + "type": "src::roles_interface::GovernanceAdminRemoved" + }, + { + "kind": "nested", + "name": "UpgradeGovernorAdded", + "type": "src::roles_interface::UpgradeGovernorAdded" + }, + { + "kind": "nested", + "name": "UpgradeGovernorRemoved", + "type": "src::roles_interface::UpgradeGovernorRemoved" + } + ] + } + ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 742b735d..887dd77b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -780,10 +780,10 @@ importers: version: link:../plugin-trustdb '@avnu/avnu-sdk': specifier: ^2.1.1 - version: 2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.11.0(encoding@0.1.13)) + version: 2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.17.0(encoding@0.1.13)) starknet: - specifier: ^6.11.0 - version: 6.11.0(encoding@0.1.13) + specifier: ^6.17.0 + version: 6.17.0(encoding@0.1.13) tsup: specifier: ^8.3.5 version: 8.3.5(jiti@1.21.6)(postcss@8.4.47)(typescript@5.6.3)(yaml@2.6.0) @@ -2795,9 +2795,6 @@ packages: '@noble/curves@1.3.0': resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} - '@noble/curves@1.4.2': - resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} - '@noble/curves@1.6.0': resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} engines: {node: ^14.21.3 || >=16} @@ -2810,10 +2807,6 @@ packages: resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} - '@noble/hashes@1.4.0': - resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} - engines: {node: '>= 16'} - '@noble/hashes@1.5.0': resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} engines: {node: ^14.21.3 || >=16} @@ -6889,9 +6882,6 @@ packages: resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} engines: {node: '>=8'} - get-starknet-core@4.0.0: - resolution: {integrity: sha512-6pLmidQZkC3wZsrHY99grQHoGpuuXqkbSP65F8ov1/JsEI8DDLkhsAuLCKFzNOK56cJp+f1bWWfTJ57e9r5eqQ==} - get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -10865,8 +10855,8 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - starknet@6.11.0: - resolution: {integrity: sha512-u50KrGDi9fbu1Ogu7ynwF/tSeFlp3mzOg1/Y5x50tYFICImo3OfY4lOz9OtYDk404HK4eUujKkhov9tG7GAKlg==} + starknet@6.17.0: + resolution: {integrity: sha512-ZzqurYL8+Y0pnIXXvxnMc+8we4jhwH/qFG5tOkaAgWSPyTR44qbBjHSOMNO1eRAmkVg9IEdiBVaG5vTpiF8kTQ==} statuses@1.5.0: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} @@ -12493,11 +12483,11 @@ snapshots: '@anush008/tokenizers-linux-x64-gnu': 0.0.0 '@anush008/tokenizers-win32-x64-msvc': 0.0.0 - '@avnu/avnu-sdk@2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.11.0(encoding@0.1.13))': + '@avnu/avnu-sdk@2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.17.0(encoding@0.1.13))': dependencies: ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) qs: 6.13.0 - starknet: 6.11.0(encoding@0.1.13) + starknet: 6.17.0(encoding@0.1.13) '@babel/code-frame@7.26.2': dependencies: @@ -15484,10 +15474,6 @@ snapshots: dependencies: '@noble/hashes': 1.3.3 - '@noble/curves@1.4.2': - dependencies: - '@noble/hashes': 1.4.0 - '@noble/curves@1.6.0': dependencies: '@noble/hashes': 1.5.0 @@ -15496,8 +15482,6 @@ snapshots: '@noble/hashes@1.3.3': {} - '@noble/hashes@1.4.0': {} - '@noble/hashes@1.5.0': {} '@node-llama-cpp/linux-arm64@3.1.1': @@ -20237,10 +20221,6 @@ snapshots: get-port@5.1.1: {} - get-starknet-core@4.0.0: - dependencies: - '@starknet-io/types-js': 0.7.7 - get-stream@5.2.0: dependencies: pump: 3.0.2 @@ -25395,21 +25375,19 @@ snapshots: stackback@0.0.2: {} - starknet@6.11.0(encoding@0.1.13): + starknet@6.17.0(encoding@0.1.13): dependencies: - '@noble/curves': 1.4.2 - '@noble/hashes': 1.5.0 + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 '@scure/base': 1.1.9 '@scure/starknet': 1.0.0 abi-wan-kanabi: 2.2.3 fetch-cookie: 3.0.1 - get-starknet-core: 4.0.0 isomorphic-fetch: 3.0.0(encoding@0.1.13) lossless-json: 4.0.2 pako: 2.1.0 starknet-types-07: '@starknet-io/types-js@0.7.7' ts-mixer: 6.0.4 - url-join: 4.0.1 transitivePeerDependencies: - encoding