eosnetworkfoundation / devrel

1 stars 0 forks source link

EVM - How to migrate your Dapps from EVM compatible chain to TrustEVM #142

Open VEG-Ginna opened 1 year ago

VEG-Ginna commented 1 year ago

Needs refinement and create separate tickets for each deliverable

Deliverables:

Child of https://github.com/eosnetworkfoundation/devrel/issues/91

More info provided by the SMEs https://docs.google.com/document/d/1ecFrIfbzD_XGhufhTmZKDNAnem7is3IAwWauXbeNs18/edit?usp=sharing

iamveritas commented 1 year ago

Researched successfully as of now:

  1. deploy smart contract on 1.1. truffle and 1.2. remix, 1.3. hardhat NOT tried yet
  2. verify smart contract
  3. connect metamask to testnet
  4. execute contract actions with remix
  5. create, build, deploy, test an ERC-20 fungible token
iamveritas commented 1 year ago

I suggest the following documentation to be written:

  1. How To Connect Metamask To A Trust Node
  2. How To Develop And Deploy On Trust An EVM Smart Contract 2.1. Using Truffle 2.2. Using Remix
  3. How To Verify A Deployed EVM Smart Contract
  4. Trust EVM versus EVM: important differences (we do not have the necessary info from SMEs for this one)
iamveritas commented 1 year ago

for point 4. Trust EVM versus EVM: important differences from previous comment this is what we got from SME

TIMESTAMP
The timestamp of each block would be the ceiling timestamp of the last underlying EOS block.

BLOCKID
As we have fixed one block every second, the block id got in contract can be effectively calculated from timestamp:
id = timestamp in ms - genesis timestamp in ms

BLOCKHASH
The blockhash is calculated from block height and some salts. 
block_hash = sha256(0x0, block_height, chain_id),
where 
block_height is the current block height in uint64
chain_id is the chain_id used in uint64

COINBASE
The coinbase will be set to *0x0000000000000000000000000000000000000000*

DIFFICULTY
The difficulty will be fixed to 0.

GASLIMIT
The difficulty will be fixed to 0x7ffffffffff