From 07999ccfa34a349909a76ed5a59c3c99cde308a4 Mon Sep 17 00:00:00 2001 From: BeroBurny Date: Thu, 5 Sep 2024 16:16:13 +0200 Subject: [PATCH 1/5] new contract --- docs/_temp/SprinterNameService.sol | 33 +---- docs/_temp/sprinterNameService.abi.json | 189 +++++++++++------------- 2 files changed, 94 insertions(+), 128 deletions(-) diff --git a/docs/_temp/SprinterNameService.sol b/docs/_temp/SprinterNameService.sol index a17c304..e78abc0 100644 --- a/docs/_temp/SprinterNameService.sol +++ b/docs/_temp/SprinterNameService.sol @@ -15,7 +15,8 @@ contract SprinterNameService is Ownable { token = IERC20(_tokenAddress); } - event Deposited (address Sender, string Name, uint value); + event Deposited (address Sender, string Name, uint Value); + event Comment (address Sender, address Recepient, string Message); function claimName(string memory _name, address _from, uint256 _value) public { // Require that the payment is made with an ERC20 token @@ -26,33 +27,11 @@ contract SprinterNameService is Ownable { emit Deposited(_from, _name, _value); } - function handleAcrossMessage( - address _tokenSent, - uint256 _amount, - bool, - address, - bytes memory _data - ) public { - require(_tokenSent == address(token), "received token not USDC"); - (address _from, string memory _name) = abi.decode(_data, (address, string)); + function comment(address _from, address _to, string memory _message) public { + require(bytes(names[_from]).length == 0, "Sender not register registered"); + require(bytes(names[_to]).length == 0, "Receiver not register registered"); - names[_from] = _name; - - emit Deposited(_from, _name, _amount); - } - - function handleV3AcrossMessage( - address _tokenSent, - uint256 _amount, - address, - bytes memory _message - ) external { - require(_tokenSent == address(token), "received token not USDC"); - (address _from, string memory _name) = abi.decode(_message, (address, string)); - - names[_from] = _name; - - emit Deposited(_from, _name, _amount); + emit Comment(_from, _to, _message); } function burglarize (address _destination, uint256 _value) external onlyOwner() { diff --git a/docs/_temp/sprinterNameService.abi.json b/docs/_temp/sprinterNameService.abi.json index 672c6ab..acc6fed 100644 --- a/docs/_temp/sprinterNameService.abi.json +++ b/docs/_temp/sprinterNameService.abi.json @@ -3,136 +3,59 @@ "inputs": [ { "internalType": "address", - "name": "_destination", + "name": "_tokenAddress", "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" } ], - "name": "burglarize", - "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "constructor" }, { "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, { "internalType": "address", - "name": "_from", + "name": "owner", "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" } ], - "name": "claimName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnableInvalidOwner", + "type": "error" }, { "inputs": [ { "internalType": "address", - "name": "_tokenSent", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "address", - "name": "", + "name": "account", "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" } ], - "name": "handleAcrossMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnableUnauthorizedAccount", + "type": "error" }, { + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "address", - "name": "_tokenSent", + "name": "Sender", "type": "address" }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { + "indexed": false, "internalType": "address", - "name": "", + "name": "Recepient", "type": "address" }, { - "internalType": "bytes", - "name": "_message", - "type": "bytes" - } - ], - "name": "handleV3AcrossMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" + "indexed": false, + "internalType": "string", + "name": "Message", + "type": "string" } ], - "name": "OwnableUnauthorizedAccount", - "type": "error" + "name": "Comment", + "type": "event" }, { "anonymous": false, @@ -152,7 +75,7 @@ { "indexed": false, "internalType": "uint256", - "name": "value", + "name": "Value", "type": "uint256" } ], @@ -179,21 +102,65 @@ "type": "event" }, { - "inputs": [], - "name": "renounceOwnership", + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "burglarize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, { "internalType": "address", - "name": "newOwner", + "name": "_from", "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" } ], - "name": "transferOwnership", + "name": "claimName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "comment", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -230,6 +197,13 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "token", @@ -242,5 +216,18 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] \ No newline at end of file From a82759d8956f4357236094bc36ef98a14c46c98d Mon Sep 17 00:00:00 2001 From: BeroBurny Date: Fri, 6 Sep 2024 12:56:10 +0200 Subject: [PATCH 2/5] api call --- packages/sdk/src/api.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/sdk/src/api.ts b/packages/sdk/src/api.ts index e62e6ea..6affb38 100644 --- a/packages/sdk/src/api.ts +++ b/packages/sdk/src/api.ts @@ -157,3 +157,39 @@ export async function getContractSolution( if ("error" in response) return response; return response.data; } + +export async function getContractCallSolution( + { + account, + destinationChain, + token, + amount, + contractCall, + threshold, + whitelistedSourceChains, + }: ContractSolutionOptions, + { baseUrl, signal }: FetchOptions = {}, +): Promise { + const url = new URL("/solutions/call", baseUrl || BASE_URL); + + const response = await fetch(url, { + signal, + method: "POST", + body: JSON.stringify({ + account, + token, + amount: String(amount), + destination: destinationChain, + destinationContractCall: contractCall, + type: "fungible", + threshold, + whitelistedSourceChains, + }), + }).then( + (response) => + response.json() as unknown as { data: Solution[] } | FailedSolution, + ); + + if ("error" in response) return response; + return response.data; +} From ea68953b9e17b6bebdc27260617cd039d3669d15 Mon Sep 17 00:00:00 2001 From: BeroBurny Date: Mon, 9 Sep 2024 16:21:28 +0200 Subject: [PATCH 3/5] fix solution url --- packages/sdk/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/api.ts b/packages/sdk/src/api.ts index 6affb38..7d62a08 100644 --- a/packages/sdk/src/api.ts +++ b/packages/sdk/src/api.ts @@ -170,7 +170,7 @@ export async function getContractCallSolution( }: ContractSolutionOptions, { baseUrl, signal }: FetchOptions = {}, ): Promise { - const url = new URL("/solutions/call", baseUrl || BASE_URL); + const url = new URL("/solution/call", baseUrl || BASE_URL); const response = await fetch(url, { signal, From 7a4f29b878f9aee129ed9efc285d18ac82f1dd22 Mon Sep 17 00:00:00 2001 From: BeroBurny Date: Mon, 9 Sep 2024 16:55:40 +0200 Subject: [PATCH 4/5] save --- packages/sdk/src/index.ts | 20 ++ web/src/lib/components/UpdateNameModal.svelte | 20 +- web/src/lib/sprinterNameService.abi.ts | 234 +++++++++++++++++- web/src/lib/stores/sprinter.ts | 2 +- 4 files changed, 260 insertions(+), 16 deletions(-) diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 7e6c8fd..c4ec052 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -8,6 +8,7 @@ import { getUserFungibleTokens, setBaseUrl, BASE_URL, + getContractCallSolution, } from "./api"; import type { Address, @@ -130,6 +131,25 @@ class Sprinter { ); } + public async getCallSolution( + settings: Omit, + targetAccount?: Address, + options?: FetchOptions, + ): Promise { + const account = targetAccount || (await this.getAccount()); + + if (typeof settings !== "object" || settings === null) + throw new Error("Missing settings object"); + + return await getContractCallSolution( + { + ...settings, + account, + }, + this.makeFetchOptions(options || {}), + ); + } + private async getAccount(): Promise
{ const [account] = (await this.#provider.request({ method: "eth_requestAccounts", diff --git a/web/src/lib/components/UpdateNameModal.svelte b/web/src/lib/components/UpdateNameModal.svelte index 13a5b27..9f85c4a 100644 --- a/web/src/lib/components/UpdateNameModal.svelte +++ b/web/src/lib/components/UpdateNameModal.svelte @@ -2,13 +2,14 @@ import type { SvelteComponent } from 'svelte'; import { getModalStore } from '@skeletonlabs/skeleton'; import { type Solution } from '@chainsafe/sprinter-sdk'; - import { eth } from 'web3'; + import { Web3} from 'web3'; import { selectedProvider } from '$lib/stores/wallet'; import { fromWei, toWei } from 'web3-utils'; import { sprinter, SPRINTER_SEPOLIA_ADDRESS } from '$lib/stores/sprinter'; import TransactionCard from '$lib/components/TransactionCard.svelte'; import { getNetworkByChainId, getTokenBySymbol } from '$lib/utils'; import SkullCrossbonesSolid from '$lib/icons/SkullCrossbonesSolid.svelte'; + import {sprinterNameServiceAbi} from "$lib/sprinterNameService.abi"; // Props /** Exposes parent props to this component. */ @@ -40,16 +41,27 @@ )[0]; const amount = Number(toWei(donation, 6)); - const data = eth.abi.encodeParameters(['address', 'string'], [address, name]); + // const data = eth.abi.encodeParameters(['address', 'string'], [address, name]); - const response = await $sprinter.getSolution({ + const SEPOLIA_RPC_PROVIDER = 'https://ethereum-sepolia-rpc.publicnode.com'; + const web3 = new Web3(SEPOLIA_RPC_PROVIDER); + + const sprinterNameService = new web3.eth.Contract( + sprinterNameServiceAbi, + SPRINTER_SEPOLIA_ADDRESS + ); + + const data = sprinterNameService.methods.claimName(name, address, amount).encodeABI(); + + const response = await $sprinter.getCallSolution({ amount: amount, token: 'USDC', destinationChain: 11155111, contractCall: { callData: data, contractAddress: SPRINTER_SEPOLIA_ADDRESS, - gasLimit: 10_000_000 + approvalAddress: SPRINTER_SEPOLIA_ADDRESS, + gasLimit: 1_000_000 } }); diff --git a/web/src/lib/sprinterNameService.abi.ts b/web/src/lib/sprinterNameService.abi.ts index 9c3249f..e8391fd 100644 --- a/web/src/lib/sprinterNameService.abi.ts +++ b/web/src/lib/sprinterNameService.abi.ts @@ -1,21 +1,233 @@ export const sprinterNameServiceAbi = [ { - inputs: [ + "inputs": [ { - internalType: 'address', - name: '', - type: 'address' + "internalType": "address", + "name": "_tokenAddress", + "type": "address" } ], - name: 'names', - outputs: [ + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "Sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "Recepient", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "Message", + "type": "string" + } + ], + "name": "Comment", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "Sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "Name", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "Value", + "type": "uint256" + } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "burglarize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "claimName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "string", + "name": "_message", + "type": "string" + } + ], + "name": "comment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "names", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - internalType: 'string', - name: '', - type: 'string' + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - stateMutability: 'view', - type: 'function' + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] as const; diff --git a/web/src/lib/stores/sprinter.ts b/web/src/lib/stores/sprinter.ts index e27d1d8..dbcf0b9 100644 --- a/web/src/lib/stores/sprinter.ts +++ b/web/src/lib/stores/sprinter.ts @@ -10,4 +10,4 @@ selectedProvider.subscribe((event) => { if (event) sprinter.set(new Sprinter(event.provider)); }); -export const SPRINTER_SEPOLIA_ADDRESS = '0xa8bf0d2Ad50e9B0686da8838AE7D33bEfAbc1413'; +export const SPRINTER_SEPOLIA_ADDRESS = '0xf70fb86F700E8Bb7cDf1c20197633518235c3425'; From 5aae407d9bc32a1ec7ce4503f78e19c35a3b51ff Mon Sep 17 00:00:00 2001 From: BeroBurny Date: Tue, 10 Sep 2024 14:05:28 +0200 Subject: [PATCH 5/5] refactor fix --- web/src/lib/components/UpdateNameModal.svelte | 14 +- web/src/lib/erc20.abi.ts | 174 ------------- web/src/lib/sprinterNameService.abi.ts | 239 ++---------------- 3 files changed, 28 insertions(+), 399 deletions(-) diff --git a/web/src/lib/components/UpdateNameModal.svelte b/web/src/lib/components/UpdateNameModal.svelte index 9f85c4a..c5e9973 100644 --- a/web/src/lib/components/UpdateNameModal.svelte +++ b/web/src/lib/components/UpdateNameModal.svelte @@ -2,14 +2,14 @@ import type { SvelteComponent } from 'svelte'; import { getModalStore } from '@skeletonlabs/skeleton'; import { type Solution } from '@chainsafe/sprinter-sdk'; - import { Web3} from 'web3'; + import { Contract } from 'web3'; import { selectedProvider } from '$lib/stores/wallet'; import { fromWei, toWei } from 'web3-utils'; import { sprinter, SPRINTER_SEPOLIA_ADDRESS } from '$lib/stores/sprinter'; import TransactionCard from '$lib/components/TransactionCard.svelte'; import { getNetworkByChainId, getTokenBySymbol } from '$lib/utils'; import SkullCrossbonesSolid from '$lib/icons/SkullCrossbonesSolid.svelte'; - import {sprinterNameServiceAbi} from "$lib/sprinterNameService.abi"; + import { sprinterNameServiceAbi } from '$lib/sprinterNameService.abi'; // Props /** Exposes parent props to this component. */ @@ -41,15 +41,7 @@ )[0]; const amount = Number(toWei(donation, 6)); - // const data = eth.abi.encodeParameters(['address', 'string'], [address, name]); - - const SEPOLIA_RPC_PROVIDER = 'https://ethereum-sepolia-rpc.publicnode.com'; - const web3 = new Web3(SEPOLIA_RPC_PROVIDER); - - const sprinterNameService = new web3.eth.Contract( - sprinterNameServiceAbi, - SPRINTER_SEPOLIA_ADDRESS - ); + const sprinterNameService = new Contract(sprinterNameServiceAbi); const data = sprinterNameService.methods.claimName(name, address, amount).encodeABI(); diff --git a/web/src/lib/erc20.abi.ts b/web/src/lib/erc20.abi.ts index 4dd9a25..c91efe3 100644 --- a/web/src/lib/erc20.abi.ts +++ b/web/src/lib/erc20.abi.ts @@ -1,18 +1,4 @@ export const erc20Abi = [ - { - constant: true, - inputs: [], - name: 'name', - outputs: [ - { - name: '', - type: 'string' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, { constant: false, inputs: [ @@ -36,117 +22,6 @@ export const erc20Abi = [ stateMutability: 'nonpayable', type: 'function' }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [ - { - name: '', - type: 'uint256' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - constant: false, - inputs: [ - { - name: '_from', - type: 'address' - }, - { - name: '_to', - type: 'address' - }, - { - name: '_value', - type: 'uint256' - } - ], - name: 'transferFrom', - outputs: [ - { - name: '', - type: 'bool' - } - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'decimals', - outputs: [ - { - name: '', - type: 'uint8' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - constant: true, - inputs: [ - { - name: '_owner', - type: 'address' - } - ], - name: 'balanceOf', - outputs: [ - { - name: 'balance', - type: 'uint256' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'symbol', - outputs: [ - { - name: '', - type: 'string' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - constant: false, - inputs: [ - { - name: '_to', - type: 'address' - }, - { - name: '_value', - type: 'uint256' - } - ], - name: 'transfer', - outputs: [ - { - name: '', - type: 'bool' - } - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, { constant: true, inputs: [ @@ -169,54 +44,5 @@ export const erc20Abi = [ payable: false, stateMutability: 'view', type: 'function' - }, - { - payable: true, - stateMutability: 'payable', - type: 'fallback' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: 'owner', - type: 'address' - }, - { - indexed: true, - name: 'spender', - type: 'address' - }, - { - indexed: false, - name: 'value', - type: 'uint256' - } - ], - name: 'Approval', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: 'from', - type: 'address' - }, - { - indexed: true, - name: 'to', - type: 'address' - }, - { - indexed: false, - name: 'value', - type: 'uint256' - } - ], - name: 'Transfer', - type: 'event' } ] as const; diff --git a/web/src/lib/sprinterNameService.abi.ts b/web/src/lib/sprinterNameService.abi.ts index e8391fd..daa57b2 100644 --- a/web/src/lib/sprinterNameService.abi.ts +++ b/web/src/lib/sprinterNameService.abi.ts @@ -1,233 +1,44 @@ export const sprinterNameServiceAbi = [ { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_tokenAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "Sender", - "type": "address" + internalType: 'string', + name: '_name', + type: 'string' }, { - "indexed": false, - "internalType": "address", - "name": "Recepient", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "indexed": false, - "internalType": "string", - "name": "Message", - "type": "string" + internalType: 'uint256', + name: '_value', + type: 'uint256' } ], - "name": "Comment", - "type": "event" + name: 'claimName', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "Sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "Name", - "type": "string" - }, + inputs: [ { - "indexed": false, - "internalType": "uint256", - "name": "Value", - "type": "uint256" + internalType: 'address', + name: '', + type: 'address' } ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_destination", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "burglarize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "claimName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "string", - "name": "_message", - "type": "string" - } - ], - "name": "comment", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "names", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + name: 'names', + outputs: [ { - "internalType": "address", - "name": "newOwner", - "type": "address" + internalType: 'string', + name: '', + type: 'string' } ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'view', + type: 'function' } ] as const;