description |
---|
Use Nifty Wallet to interact with smart contracts |
{% hint style="warning" %}
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.
See instructions to move your address to another wallet. {% endhint %}
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.
{% hint style="info" %} 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. {% endhint %}
{% hint style="success" %} 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. {% endhint %}
- Connect to the chain where the contract is deployed. Here we use the xDai chain.
- Click on the Accounts Icon.
- Scroll down and select Import Account.
- Choose Contract in Select Type Dropdown.
- 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. - Click Import.
- 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.
- Click the Execute Methods button to see all of the available methods. We choose the transfer method.
The transfer method accepts two arguments.
- In the
_to
field, we enter the bridge mediator contract address0xD9a3039cfC70aF84AC9E566A2526fD3b683B995B
- In the _
_
_value
field, 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) - 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.
{% embed url="https://blockscout.com/poa/xdai/tx/0xee82d23b5f517a5ded4af7c2720d9d96fe52823c8ad9c2cd33ca86f7f5e3a9e4/token_transfers" %}