-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass in bytes32 #100
Comments
Which parameter is this? I think you are doing it correctly, but I am not sure. |
Can you also provide a traceback. |
The console log is as follows when single quotes used. The function is_encodable in web3 module (web3.utils.abi) returns false since it requires the input as a string with length<=32 for type bytes32. But I think this is fine. I guess the problem should be at the stage of reading the data from yml file. There should be something to convert such value into bytes data, instead of treating such value as a normal string. If without single quotes, the value was treated as a number and converted to decimal number. The log printed something like: The italic bold text was something from web3 since I added some prints. (venv) $ deploy-contracts --deployment-file=crowdsales/presale.yml --deployment-name=testnet --address=0x627306090abaB3A6e1400e9345bC60c78a8BEf57 The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I've been running into the exact same error with just a simple token contract. With the following code: with project.get_chain(chain_name) as chain:
web3 = chain.web3
# print(web3.eth.accounts)
# print(web3.eth.blockNumber)
Contract = get_contract_by_name(chain, "CrowdsaleToken")
contract = Contract(address=contract_address)
pp.pprint(contract.abi) I get this response:
This would suggest that the ABI has all the functions I need, but when I call a contract I get the following: with project.get_chain(chain_name) as chain:
web3 = chain.web3
# print(web3.eth.accounts)
# print(web3.eth.blockNumber)
Contract = get_contract_by_name(chain, "CrowdsaleToken")
contract = Contract(address=contract_address)
print(contract.call().canUpgrade())
# pp.pprint(contract.call().totalSupply) We get:
|
For a constructor function with bytes32 parameter, how can I pass in the data (e.g. 0x18e070eea80451e1210b1e9755b04c20af10d531c0a0e9fbdd446563c22fc08c) when deploying it via the yml file. I tried 0x18e070eea80451e1210b1e9755b04c20af10d531c0a0e9fbdd446563c22fc08c with/without quotes. Both didn't work.
The text was updated successfully, but these errors were encountered: