aurora-is-near / aurora-engine

⚙️ Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol.
https://doc.aurora.dev/develop/compat/evm
327 stars 80 forks source link

feat: possibility to set metadata for erc20 contracts #837

Closed aleksuss closed 1 year ago

aleksuss commented 1 year ago

Description

The PR adds functions for setting (set_erc20_metadata) and getting (get_erc20_metadata) metadata of ERC-20 contracts deployed with deploy_erc20_token transaction.

Performance / NEAR gas cost considerations

There are no performance changes.

Testing

The corresponding test has been added.

Additional information

Probably, there should be a new role for set_erc20_metadata transaction. I guess it should be added in a new PR.

aleksuss commented 1 year ago

One bad moment of changing borsh to JSON is that it increases the number of functions and size of the smart contract. cc @birchmd

birchmd commented 1 year ago

Increasing the number of functions is ok in my opinion. The reason for counting them is because there is a hard limit on the number of functions Near allows in a contract. But this limit is 10000, so we are not close to exceeding it.

How much bigger is the contract size? Will it be offset by the wasm opt improvment?

aleksuss commented 1 year ago

How much bigger is the contract size? Will it be offset by the wasm opt improvement?

1166962 vs 1060706 (develop), diff: 106256 bytes. After applying wasm-opt the size becomes 1041185 bytes.