Hello I have some funds stuck inside my contract and my code isn't working as it would in the test net. Is there a way to terminate the contract as the owner and get the funds back? I have no destruct like function implemented and there is no co-contract association. If not, then maybe/how should I construct the dataset to send the fallback function such a signal (fallback is external payable) ?

Dec 19, 2022, 8:54 AM
share the contract
Dec 19, 2022, 9:02 AM
pragma solidity ^0.5.0;

......code

contract MyContract {
string public tokenName;
string public tokenSymbol;
uint loanAmount;

constructor(string memory _tokenName, string memory _tokenSymbol, uint _loanAmount) public {
tokenName = _tokenName;
tokenSymbol = _tokenSymbol;
loanAmount = _loanAmount;
}
address public creator= msg.sender;
function tokenTransfer() public view returns (address) {
return creator;
}

......code

function() external payable {}

function pay() public payable {
address(uint160(winner())).transfer(address(this).balance);

......code
so its something like this but the winner function is returning null
Dec 19, 2022, 9:12 AM
you didn't share the winner function...
guys if you ask help but can't share your top secret code you won't receive anything useful
Dec 19, 2022, 9:15 AM
what a wonderful speech~ I will note down
Dec 19, 2022, 9:15 AM
its not working its returning null...
Dec 19, 2022, 9:15 AM
are you able to share the whole contract or not?
Dec 19, 2022, 9:16 AM
please do not do that
Dec 19, 2022, 9:16 AM
you wanbt to make a pull request to openzeppelin?
Dec 19, 2022, 9:36 AM
not open zeppelin, another project i'm working on that is using open zeppelin
i would need to set up foundry to automatically override the open zeppelin script
Dec 19, 2022, 9:46 AM
Can anyone help with this ? Thanks!
Dec 19, 2022, 3:31 PM
Show the code
Dec 19, 2022, 3:47 PM
start using hardhat or foundry
Dec 19, 2022, 4:48 PM
if anyone has any experience working on big project using foundry, how do you deploy multiple contracts at once
Dec 19, 2022, 4:49 PM
deploy scripts
Dec 19, 2022, 4:51 PM
ok, and what command would you use to run it?
Dec 19, 2022, 4:52 PM
forge create
Dec 19, 2022, 5:03 PM

© 2024 Draquery.com All rights reserved.