-
Notifications
You must be signed in to change notification settings - Fork 201
Initialization argument encoding issues. #421
Comments
Hey @dimonkov . Thx for the report. A couple of things look a bit awkward on your example, could you please clarify?
|
Oh, sorry if my description confused you.
Just try to deploy it once with Restart ganache and redeploy the contract, but this time with We tested this on two machines and observed exactly the same behaviour. |
@ajsantander as a side note - this article recommends using a globally installed version. |
Chiming in here to share a similar behavior I saw executing a
The On a second attempt, I tried with the |
I've just experienced the same issue trying to run: |
Same problem occurs. After switching the address arguments to lower case, the getter function for For contract below
I used the command below to have the proxy contract, where the two address below are the ones that have some Rinkeby ethers.
My truffle configuration is as below.
In truffle console for rinkeby I get response below
|
Hi guys, I've also experienced this issue and I believe it's a bug in 'helpers/encodeCall'. There is a regex check
This command gives the following output:
The output looks correct, but in fact, it initializes contract with a wrong value '0000000000000000000000000000000000000000000000000000000000000977' which is NaN after abi.rawEncode |
Yes, you are right, the documentation still has examples that show global usage of Also, thx for the clarification on the bug's description. I can reproduce it now. Will come back with an update! |
@leshaaa indeed, that was the problem. Submitting a fix =D thxx |
Seems similar to the #410, #414, #60 (especially this one, but we are not using a beta version of Truffle or Ganache).
zos create <contract> --init args [arg0, ...]
argument encoding sometimes fails.As you can see in this attached project, we have a single test contract named
o
that inherits fromOwnable
and has a single function initialize that accepts 1 argument of typeaddress
and just memorises it.The issue is that by suppling different addresses in
args
(zos create o --init --args "address_goes_here"
) and later reading the value from the contract we get very different results.With these two addresses :
'0xC2D7CF95645D33006175B78989035C7c9061d3F9'
,'0xEB1020C2BfA170489fca37068F9c857CDCd5f19F'
is seems to work just fine,however, with these two:
'0x931BEd74FF2eDCd6f7fF7504a2e74971Aaf4ABCA'
,'0x39af68cF04Abb0eF8f9d8191E1bD9c041E80e18e'
- a weird number is returned instead of the supplied address (it is0x0000000000000000000000000000000000000977
every time).We were able to identify, that with these 2 last addresses(and possibly more of them) the transaction data that is sent to the blockchain is identical (we diff'ed TxData from Ganache, it is the same),
whereas it is different with the 2 first addresses (as it should be!).
So, we came to the conclusion, that argument encoding is broken.
Please see the attached project file and follow the instructions to reproduce the issue.
Steps to reproduce the issue:
Displays
'0x0000000000000000000000000000000000000977'
.Should display
'0x39af68cF04Abb0eF8f9d8191E1bD9c041E80e18e'
.Software versions:
macOS 10.14.1
npm version { test: '1.0.0', npm: '6.4.1', ares: '1.14.0', cldr: '33.1', http_parser: '2.8.0', icu: '62.1', modules: '67', napi: '3', nghttp2: '1.34.0', node: '11.1.0', openssl: '1.1.0i', tz: '2018e', unicode: '11.0', uv: '1.23.2', v8: '7.0.276.32-node.7', zlib: '1.2.11' }
Truffle v4.1.14 (core: 4.1.14)
Solidity v0.4.24 (solc-js)
Ganache GUI version v1.2.2
ZeppelinOS version 2.0.1
The text was updated successfully, but these errors were encountered: