Comment on page
Import and Interact with Smart Contracts
Use Nifty Wallet to interact with smart contracts
Nifty Wallet is discontinued. As a result of changing crypto market conditions and to continually improve support for our growing family of Gnosis Chain products, certain existing products will be retired in 2022. This list includes the Nifty Wallet browser wallet. Nifty Wallet extension will be delisted from Google Chrome web store in the near future.
Nifty wallet is designed for developer interaction. You can import BlockScout verified contracts simply by entering the contract address - the ABI automatically populates from there. If a contract is not BlockScout verified, you can also paste in the ABI.
In this example, we import a token contract and send an amount to a bridge mediator contract, which transfers the token (sUSD) from the xDai chain to the Ethereum Mainnet.
This tutorial is for demonstration purposes for using the Contract Import and Interaction features of Nifty wallet. You need sUSD on the xDai chain to complete the exact steps below. If interested, you can obtain through this process.
We recommend starting with a contract deployed to a testnet (like Kovan, Sokol, etc) to explore your contract functionality fully without spending any real currency.
- 1.Connect to the chain where the contract is deployed. Here we use the xDai chain.
- 2.Click on the Accounts Icon.
- 3.Scroll down and select Import Account.
- 1.Choose Contract in Select Type Dropdown.
- 2.Paste in the Contract Address (we use
0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e). If the contract is verified in BlockScout, the ABI will auto-populate. If not, paste the ABI. Here are a few ways to retrieve the ABI of a contract.
- 3.Click Import.
- 1.This makes the account easier to find. Hover over the account name and "edit" will appear. Click on edit to change the name. Click Save.
- 1.Click the Execute Methods button to see all of the available methods. We choose the transfer method.
We select the transfer method. You can interact with any method from the Nifty interface.
The transfer method accepts two arguments.
- 1.In the
_tofield, we enter the bridge mediator contract address
- 2.In the
valuefield, we enter a value of sUSD in Wei to transfer. We must have this amount in the account we will use to execute the call (min 0.5 sUSD or 500000000000000000 Wei)
- 3.Click Next to continue.
Select an address to execute the contract call. In this case, the address must contain the amount of sUSD to transfer as well as a small amount of xDai to cover the gas costs. Choose an address and press Next.
Check gas fees and details and press Submit. The transaction should process. Once confirmed, check in BlockScout, and change networks to the Eth Mainnet see the new Balance.
Click Submit to complete the transfer
Switch to Main Network to view token balances (Prior SUSD balance was 0.32 before the transaction)