Comments (7)
Yeah,
I know that the nonces supposed to be random but if we at least get any controls over this issue, we can handle our nonces locally to finally support vechain.
from thor.
For CREATE
you can calculate the contract address before sending the tx, take a look at
Lines 107 to 112 in bee753f
you need
txID
, clauseIndex
and creationCount
. Regarding the creationCount
, it's the overall contract creation count for one clause, so if you send a tx with one clause {to: null, data: <creation code>}
then it should be 0. Please forgive me, it starts from 0 not 1To generate the address you wanted, you need to change nonce in the tx then txID is generated and you will get the contract address. Regarding
nonce
it is a random number in tx which is different from ethereum's account nocne.from thor.
Lines 19 to 20 in bee753f
CREATE2
is also available.
from thor.
Dear @libotony,
Thanks kindly for your response.
Regarding the
creationCount
, it's the overall contract creation count for one clause, so if you send a tx with one clause{to: null, data: <creation code>}
then it should be 1.
We need to reach the exact same contract address in CREATE
due to the fact that we provide exchanges contract wallets for their users(unless the same user address will not accessible in Vechain network and causes fund loss in recovery plans). However, the minimum amount of creationCount
is 1 in your solution and our generated mother contract address has nonce on 0.
CREATE2
is OK, however, we must first deploy the same address mother with CREATE
in Vechain.
Do you have any solution for nonce 0?
Regards,
from thor.
We have a different tx-model than Ethereum. Take a look at the function signature:
// Ethereum
func CreateAddress(caller common.Address, nonce uint64) Address
// VeChain
func CreateContractAddress(txID Bytes32, clauseIndex uint32, creationCount uint32) Address
Regardless of the creationCount
, you might not be able to create the same contract address using the same method of Ethereum. Luckily CREATE2 works.
And I took another look into the source code, creationCount
starts from 0.
from thor.
Thanks a lot. I see the differences now. I'm not familiar with evm code and their effect on all nodes. Is it possible you add some other function like CREATELEGECY
in your evm which act like ethereum one?
from thor.
@aghamir I am afraid this can not be done, sorry for the inconvenience. Closing this issue, feel free to reopen or append comments.
from thor.
Related Issues (20)
- Node fails during sync. with writer-errors HOT 4
- Error when compiling the code HOT 2
- Unknown error while creating custom network HOT 10
- Support ARM based architectures such as Amazon EC2 Graviton2 CPUs HOT 3
- How to set the URL of a custom node HOT 12
- Where is the VIP-212? HOT 1
- How to prune the deduped trie nodes? HOT 12
- Why not delete the deleted leaves but put empty values? HOT 18
- Is it possible that use the key of a leaf value as the leaf's path? HOT 3
- What's the benefit of using xxx+name+path instead of xxx+nodeHash as store-key? HOT 28
- Why not use the account address as the trie name? HOT 23
- Add support for debug_traceCall for EIP-4337 HOT 1
- Docker container set up for Node is not working HOT 42
- Transactions of VET HOT 13
- VTHO tokens data HOT 3
- [email protected]
- How to differentiate between events transfer and events approval from the json response we are getting from the transaction API. HOT 3
- VTHO Tokens Data. (Generated value & paid value) HOT 4
- VeChain1
- [e2e] Single clause VET transfer - positive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thor.