Best Practices

Call contract method with contractInstance.contractMethod(...)

There are two ways to call a contract method.

  1. contractInstance.contractMethod(params).sendTransaction(...)...
  2. cfx.sendTransaction({..., data: contractInstance.contractMethod(params).data})...

Please use the first one. Portal can read the params and display them in the user confirmation popup so that users can get more information about what's dapps' requests, for example, how much token/cfx the transaction costs.

Default Token List

If you're a major and popular token, you may qualify to be listed in our cfx-contract-metadata registry. This is a centralized solution and takes a larger toll on our development team, so we prefer to avoid the politics of picking and choosing tokens that get auto-detected in users' accounts, so please see if the EIP-747 method above can suit your needs before submitting a new token there for inclusion.

If you have a user on your site, asking them to click once to add a token is a small burden on them, and allows you to leverage the trusting relationship you already have with your user instead of our central repository.

Defining Your App's Icon

When your site makes a login request to a Confluxi Portal user, Confluxi Portal may render a modal that display's your site icon.

We retrieve this icon using the HTML selector head > link[rel="shortcut icon"], so to customize this icon for your site, just make sure to follow the favicon standard, and make sure to have a link tag within your site's head with rel = "shortcut icon", like this.

The tag's href attribute will be used for assigning the site icon.

<head>
<link rel="shortcut icon" href="https://your-site.com/your-icon.png">
</head>
Last updated on by yqrashawn