Web3 & MetaMask - Bubble plugin
Get PluginAll our plugins
  • Overview
  • Quick Start Example
  • Elements details
    • Web3 & MetaMask
      • Connect To MetaMask
      • Disconnect MetaMask
      • Send token With MetaMask
      • Get Balance of a Token
      • Get Balance of Multiple Tokens
      • Get Token Symbol
      • Sign
      • Check signature
      • Sign Typed Data
      • Check signature-Typed Data
      • Smart Contract - Read
        • Example - CAKE/BUSD rate on Pancaksewap
      • Smart Contract - Write
        • Example - Write a function
      • Trigger Switch Chain
      • Approve - Set Allowance
      • Revoke Allowance
      • Deploy Contract
      • Add Chain to MetaMask
      • Get NFT Metadata
      • Check NFT Balance
      • Smart Contract - Read
      • Smart Contract - Write
    • Web3 Utils
      • Get Transaction confirmations
      • Get Transaction Details
      • To Wei
      • From Wei
      • Add Token to MetaMask
      • Get ENS data
      • Get ENS Domain from Address
  • Use with other Wallets & Plugins
  • Sign up a user with signature
  • How to use on Mobile
Powered by GitBook
On this page
  • Parameters
  • More about parameters:
  • Events
  • States
  1. Elements details
  2. Web3 & MetaMask

Smart Contract - Write

Interact with a smart contract by change, write or send data to it using its Write functions.

PreviousExample - CAKE/BUSD rate on PancaksewapNextExample - Write a function

Last updated 2 years ago

Write a function means that you can basically run smart contract functions that will "Write" data on blockchain. For example, minting a NFT token is writing a function, so you write (basically store like in a database) data on blockchain that you have minted an NFT.

Parameters

Parameter name
Type
Description

Contract address

Text

Smart Contract Address

ABI

Text

Action name

Text

Parameter 1 - Parameter 8

Text

All are optional, if the contract requires 1 parameter, for example a wallet address, set it in the Parameter 1 and leave the rest empty

Transaction Value

Text

Optional. This parameter is used when the write action needs to be paid in ETH (chain native token). It will be auto-converted to wei. For example a mint function that requires ETH as payment, use this parameter in that case, instead of the parameters from the above.

Gas Price

Text

Optional. Useful when you want to make sure the tx will confirm fast. There's no need to indicate a priority fee separately, just use this parameter.

Gas Limit

Number

Optional. Max amount to be spent on gas.

More about parameters:

Even if the parameters are text type, when you set a boolean or a number, it will be auto converted from text in the plugin.

For example, if it is a simple 1 parameter that must be a number (let's say 42), it will look like this: Parameter 1:

42

Another example, If a parameter is an array type with multiple data, set it all in one parameter by indicating the square brackets, make sure to use double quotes when it is string type. For example: Parameter 1:

["0x10ed43c718714eb63d5aa57b78b54704e256024e",true,1]

Events

See all

States

State name
Type
Description

Contract Write - Result

Text

Result will be converted to text, for example if it is JSON, you will have to parse it using regex or if it is number you will have to convert it to number type

Contract ABI. After contract deployment the ABI doesn't change, therefore it can be saved in your database and get it from there when needed. More about ABI see

This is the function name from the contract that you want to use. Case sensitive, make sure it is exactly as in the contract, for example: isOwner or balanceOf See where to find all contract functions and its parameters

Also Transaction status and Transaction Hash ID see in

from common events
common states
here
here