DeployedBytecode doesn't match - ethereum

so I encountered a weird issue with deploying bytecodes via a deployer contract. On 1 of 5 deployed contracts via the same compilation round & deployment flow I ended having a different deployedBytecode (but same bytecode) as with my original truffle compiled source. Therefore I can't get it verified. The issue seems that the address of the deployer contract is part of the deployedBytecode (while on my local file it is the null address). The issue is also only for 1 contract, while all 5 contracts share the same code (especially around the deployer address mentioned inside the contract.
So here i.e. is the deployer contract (+ verified source code):
https://polygonscan.com/address/0xd54716865c58d11e7c39c3cf634d9e919c0c6cce#code
I deployed my contract (SignerVaultV1.sol) via that tx:
https://polygonscan.com/tx/0x4d6e3a002b448e675ba6a2374737d4eaf0e18b163a57a66c09109ba332c8c5e3
The bytecode of it is exactly the same as on my local file, but if the deployedBytecodes are compared, 3 changes can be seen: Diff between online vs offline deployedBytecode (I can't post pics yet^^)
The difference in it is the address of the deployer contract (d54716865c58d11e7c39c3cf634d9e919c0c6cce). But like I said, the deployerContract delivered multiple contracts, all are correct, only this one is having that issue and I cant figure it out why.
I personally would like to get that contract verified without having to redeploy it (and maybe rund into the same issue...) I tried already to alter the source code to match the online deployedBytecode, but it seems also a harsh idea :D

Well after testing different ways, I dont honestly why, but sending a verification request via hardhat got it working... I couldn't manually verify or via truffle, but hardhat seems to know the magic for the last contract :)

Related

Chainlink Automation upKeep not working. checkUpKeep is not calling performUpKeep

Our Dapp will have an NFT Auction functionality, which we are trying to automate 100% using chainlink. The auction winner will get the NFT and the Previous owner will get the highest Bid, Platform will get a small cut as well.
To do that, we are using CHainlink Keeper/Automation. I've set the checkUpKeep & performUpKeep, both are working fine when I'm doing everything manually. But when I am registering an upKeep for automaton.
When I input the deployed contract's address into the register upkeep box, it says Unable to verify if this is an Automation compatible contract. Why this warning?
How do I make the contract Automation compatible contract?
checkUpKeep is working good:
If I pass this performData into performUpKeep everything will work fine.
Code/Contracts: https://mumbai.polygonscan.com/address/0x7e2DA19C130cb3B483FA7f17C45c70716ABF5Fe8
Chainlink upKeep: https://automation.chain.link/mumbai/21891159634677518530356555981285976030474691922841692133624884405593696766700
Pls help, Thanks.
Unable to verify if this is an Automation compatible contract usually stems from a contract that is not verified on the block explorer. The contract you linked is verified and if you create an automation with it everything is good
Your checkUpKeep function does return true when supplied with the input you show(checkData). However, you have the checkData set to 0x in your automation.
With that input, it returns false.
You will need to change the checkData to match your screenshot.

No job show up in Runs page while trying to run a Chainlink node locally

I am trying to fulfil requests on my local test chainlink node on rinkeby (following https://docs.chain.link/docs/fulfilling-requests/) but can't see any job runs appear on my operator ui.
The Oracle contract is at 0xA66f738a4688A9E51c2c6FF901CC3B11ce31AE6C
The ATestnetConsumer contract is at 0x977129EE2f404F4327A2A60C5fD9E57890D85FD0
My job toml screenshot below
Have confirmed my .env that it is running the rinkeby wss url from infura and the chain is 4 and the link token contract address is 0x01BE23585060835E02B77ef475b0Cc51aA1e0709
My node wallet has ETH and LINK. Both the contracts have Link too (but no ETH).
I run the setFulfillmentPermission function in remix with my Node wallet address and true
When I execute the requestEthereumPrice function with my oracle address and job id, I can see the LINK being sent by the ATestnetConsumer contract to the Oracle contract but no job run gets created in my local Chainlink node.
Confirming that the job hasn't run, I get the 0 value when I run the currentPrice function on ATestnetConsumer.
Can anyone please point me to where I am going wrong? Thanks in advance!
Finally got it to work. Posting my two findings as I do think the documentation needs an update to account for these.
The external job id in the Jobs screen on the Operator UI has dashes in them. To use them in the ATestnetConsumer contract you need to remove the dashes (so 0e84f38985eb4edb98c2e2a09b589666 and not 0e84f389-85eb-4edb-98c2-e2a09b589666).
The direct request toml doesn't seem to work as is. I had to append allowunrestrictednetworkaccess="true" to the fetch section so it becomes
fetch [type="http" method=GET url="$(decode_cbor.get)" allowunrestrictednetworkaccess="true"]

Error: Unable to Verify Contract source code

I am a newbie in Solidity and Ethereum smart contract deployment. I have been trying to deploy some contract on Ethereum Testnet - Ropsten. I have successfully deployed and published
But, I received the error "Unable to Verify Contract source code." when trying to publish the following source code for this contract: https://ropsten.etherscan.io/address/0x811f7cf0f9534f54c4a56c383bbaed73dc88f609#code
I didn't know where did I do wrong.
pragma solidity ^0.4.0;
contract Test3 {
uint storageData;
function set(uint x) public {
storageData = x;
}
}
Any help would be appreciated.
Ok so I don't have enough reputation to comment otherwise I would have but there are very few things that could go wrong here so Ill just go over what you need to do. And you can chat with me on discord or something if you have any other questions. First I assumed you deployed with remix. So go to the settings tab and make sure that on etherscan you selected the same version that is displayed there, otherwise it will not work and then if the optimization box is not checked which is the third checkbox down then select no on etherscan otherwise again it wont work. then you just copy the exact source code into the box and type in the name of the contract and that is it.

Gas required exceeds limit

I'm trying to deploy the following contract on Ropsten using an injected web3 environment (i.e. metamask) on remix.ethereum.org/
pragma solidity ^0.4.16;
contract Coin {
// The keyword "public" makes those variables
// readable from outside.
address public minter;
mapping (address => uint) public balances;
// Events allow light clients to react on
// changes efficiently.
event Sent(address from, address to, uint amount);
// This is the constructor whose code is
// run only when the contract is created.
function Coin() public {
minter = msg.sender;
}
}
I've been able to create contracts with ease using remix before. I'm not sure what has changed, but I can't create contracts at all because of the gas limit thing. I've even gone as far as setting the gas limit to 2 full Ethers (i.e. value 1 ether with max of 2). I have close to 3 ethers in my metamask wallet. The remix "Account" dropdown also displays my metamask address correctly so it seems that the injected environment is connected.
When I try to create this contract I can't get past the gas required exceeds limit 2 error. I'm scratching my head as to why this simple contract would exceed the cost of 2 full Ethers.
Other parameters for remix in use:
optimize=false&version=soljson-v0.4.20+commit.3155dd80.js
Is there a setting on remix that I've forgotten? I'm Trying to deploy this from Chrome.
edit: I'm still scratching my head on this one. I was able to create the contract above for a brief moment after refreshing my page, but I came in today to try and run the code from https://www.ethereum.org/token and I can't get past the exceeds gas error with a value of 20 Gwei and a limit of 3000000. Note, I tried using the simple sample contract above and I'm back to where I was when I started - even the simple "Coin" contract above apparently exceeds the gas limit.
edit 2: Well, I think I'm getting somewhere. I've changed the compiler version from "soljson-v0.4.20+commit.3155dd80.js" to "soljson-v0.4.19+commit.c4cbbb05.js". Then I refresh the page 3 times. After that I wait a couple of minutes and things seem to be working again. There is something else happening here because when I reject the transaction in metamask and then return to remix to create again, I encounter the gas exceeded error. I don't believe the issue here is metamask as I've tried to connect locally using testrpc - localhost:8545 - and experience the same issue. All I can say is that the same code that I try to create fails to submit because of the gas error most of the time but occasionally works regardless of compiler version.

Truffle MetaCoin example not working as expected

So I have a testrpc running, and two instances of the initial project created with truffle init. And they both connect to the same testrpc.
1.
When I fill in an amount and no address, it will subtract the amount from my current balance. I would expect that same balance to show up at the other instance, which is using the same account[0] ID. But it doesn't, it shows the initial 10000 there, while i would expect the actual balance to be extracted from the testrpc? What am I doing/thinking wrong here?
2.
When I try to transfer MetaCoins from account[0] to account[1] (or rather, enter the id), then modify app.js in one of the instances to account[1], run truffle build and refresh, the balance is still 0.
3.
When I try the above two on the same instance/device, it does work?
I suspect that either I'm misunderstanding some fundamental thing here, or there's a bug somewhere.
Although the testrpc is receiving an eth_sendTransaction in the terminal, when either instance does a transaction..