NibiruChain / nibiru

Nibiru Chain: The breakthrough smart contract platform ushering in the next era of money. Nibiru powers an ecosystem of dApps including perps, RWAs, and more.
https://nibiru.fi
Apache License 2.0
183 stars 201 forks source link

(evm): Use atto denomination for the wei unit in the EVM so that clients consider NIBI as "ether". #1975

Closed Unique-Divine closed 2 months ago

Unique-Divine commented 2 months ago

Status: Needs further discussion

Background Context

App Builder:

May I ask what is 1 NIBI in smart contracts? Is that 1e6? As NIBI has 6 decimals I'm trying to get info to see if we have to modify the dex contracts

@onikonychev:

You mean if you do a smart contract transfer, something like

function sendViaTransfer(address payable _to) public payable {
    // This function is no longer recommended for sending Nibi.
    _to.transfer(msg.value);
}

?

The absolute value which you are transferring is 1e6 (micronibi).

App Builder:

So 1 ether in solidity (means 1e18) is 10^12 NIBI?

@onikonychev:

Please let me know how big pain is this for you specifically and for other potential developers. If it's huge enough, maybe we reconsider and refactor to use attoNibi (1e18)