Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

how to deploy my contract #46

Closed
xxmfypp opened this issue Apr 10, 2018 · 8 comments
Closed

how to deploy my contract #46

xxmfypp opened this issue Apr 10, 2018 · 8 comments
Labels
Milestone

Comments

@xxmfypp
Copy link

xxmfypp commented Apr 10, 2018

I have a requiement : I want to use web3swift deploy my contract on my mobile. It's very Important for my Dapp. What do I need to do.

@shamatar shamatar added this to the 0.5 milestone Apr 10, 2018
@xxmfypp
Copy link
Author

xxmfypp commented Apr 10, 2018

hi shamatar
Thank you very much . but I want to know : when will release the milestone 0.5?

My Dapp needs this function very much. 😄

@shamatar
Copy link
Contributor

shamatar commented Apr 10, 2018 via email

@xxmfypp
Copy link
Author

xxmfypp commented Apr 11, 2018

Thank you .I'll check it and verify it.

@wufeiafei
Copy link

hi ,the deploy contract may be not work.
this is my code:
1523430644738

when run " let intermediate = contract?.deploy(bytecode: data, options: options)" ,
programe show Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value

@shamatar
Copy link
Contributor

Should be fixed in #48, can you test it once again?

@wufeiafei
Copy link

thank you very much. Deploy the contract is ok, but "web3.eth.getTransactionReceipt(txHash)" and "web3.eth.getTransactionDetails(txHash)" are errors.
this is my code:
1523513243979
1523513273847

the result is :
sender:
EthereumAddress(_address: "0x9d7c297261cdfa90e1f04fd4df58bf7961299bf8", type: web3swift.EthereumAddress.AddressType.normal)
Signature required 0 rounds
Transaction
Nonce: 8
Gas price: 5000000000
Gas limit: 3000000
To: 0x
Value: 0
Data: 0x6060604052341561000f57600080fd5b6103358061001e6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a16e94bf14610051578063a46b5b6b146100df575b600080fd5b341561005c57600080fd5b61006461013c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156100ea57600080fd5b61013a600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061020d565b005b610144610250565b6000808073ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102035780601f106101d857610100808354040283529160200191610203565b820191906000526020600020905b8154815290600101906020018083116101e657829003601f168201915b5050505050905090565b806000808073ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001908051906020019061024c929190610264565b5050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102a557805160ff19168380011785556102d3565b828001600101855582156102d3579182015b828111156102d25782518255916020019190600101906102b7565b5b5090506102e091906102e4565b5090565b61030691905b808211156103025760008160009055506001016102ea565b5090565b905600a165627a7a7230582017359d063cd7fdf56f19ca186a54863ce855c8f070acece905d8538fbbc4d1bf0029
v: 27
r: 29918950479422145628346085315379898386208905238976132191916594915507077075594
s: 26254431799521906505013328033636050404961808186710323392134393585661510802852
Intrinsic chainID: nil
Infered chainID: nil
sender: Optional("0x9D7c297261cdfa90E1F04fd4df58bF7961299Bf8")
hash: Optional("0x33b161f4142122b5c4c179310fda4dec4dc5aa9c5a51e75b1438c6c5671d92fa")

Transaction
Nonce: 8
Gas price: 5000000000
Gas limit: 3000000
To: 0x
Value: 0
Data: 0x6060604052341561000f57600080fd5b6103358061001e6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a16e94bf14610051578063a46b5b6b146100df575b600080fd5b341561005c57600080fd5b61006461013c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156100ea57600080fd5b61013a600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061020d565b005b610144610250565b6000808073ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102035780601f106101d857610100808354040283529160200191610203565b820191906000526020600020905b8154815290600101906020018083116101e657829003601f168201915b5050505050905090565b806000808073ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001908051906020019061024c929190610264565b5050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102a557805160ff19168380011785556102d3565b828001600101855582156102d3579182015b828111156102d25782518255916020019190600101906102b7565b5b5090506102e091906102e4565b5090565b61030691905b808211156103025760008160009055506001016102ea565b5090565b905600a165627a7a7230582017359d063cd7fdf56f19ca186a54863ce855c8f070acece905d8538fbbc4d1bf0029
v: 27
r: 29918950479422145628346085315379898386208905238976132191916594915507077075594
s: 26254431799521906505013328033636050404961808186710323392134393585661510802852
Intrinsic chainID: nil
Infered chainID: nil
sender: Optional("0x9D7c297261cdfa90E1F04fd4df58bF7961299Bf8")
hash: Optional("0x33b161f4142122b5c4c179310fda4dec4dc5aa9c5a51e75b1438c6c5671d92fa")

deploy result:
.success(["txhash": "0x33b161f4142122b5c4c179310fda4dec4dc5aa9c5a51e75b1438c6c5671d92fa", "txhashCalculated": "33b161f4142122b5c4c179310fda4dec4dc5aa9c5a51e75b1438c6c5671d92fa"])
Transaction with hash 0x33b161f4142122b5c4c179310fda4dec4dc5aa9c5a51e75b1438c6c5671d92fa
receipt:
.failure(dataError)
details:
.failure(dataError)

=====
can you check the "web3.eth.getTransactionReceipt()" and "web3.eth.getTransactionDetails()" methods?

@shamatar
Copy link
Contributor

It was indeed intended behavior, if your transaction is not yet included in block than the receipt and details are "null". In #51 I've added a convenience instance of transaction receipt with status = .notYetProcessed

@skywinder
Copy link
Contributor

@wufeiafei
Feel free to reopen the issue, if you still need help. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants