I own a contract (contract A), which in turn, when deployed, created a secondary contract (Contract B).
I have funds trapped in contract B, contract B, has a function that allows its owner to withdraw funds in the contract, but with the OnlyOwner
modifier.
The owner
of contract B is contract A, I cannot execute the call because a contract cannot sign the transaction, is there any possibility of resolving this?
I need use this function:
function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) {
uint256 amount = _withdrawDividendOfUser(account);
if(amount > 0) {
lastClaimTimes[account] = block.timestamp;
emit Claim(account, amount, automatic);
return true;
}
Or even, it would solve the problem if I could change the owner of contract B, moving it to a wallet.
but only the owner can do that, and unfortunately it's another contract.
Or even, it would solve the problem if I could change the owner of contract B, moving it to a wallet.
but only the owner can do that, and unfortunately it's another contract.
It is a contract for an ERC20 token with dividends in BNB.
We published it in 2021 and we did not have full knowledge, so perhaps we failed to foresee some situations.
The logic of the contract is,
Wallet deploy the Contract A (ERC20) Token, automatically contract B (dividends) was created and published as owner of contract A.
I have a relevant amount of BNB within contract B and would like to try to redeem it.
The calls provided for in contract A to interact with B do not include transferring ownership of contract B or calling the processaccount()
function.
If I could call the transferownership()
of Contract B (Dividends) easily I would transfer it to a wallet and then I could successfully use the ProcessAccount()
function and then I would be able to redeem the BNB in the contract. Or at least calling the processaccount()
function directly from Contract A would also work.
The problem is:
TransferOwnerShip()
and ProcessAccount()
are set to OnlyOwner
, that is, only contract A can call, but there is no function in contract A specifies to do this.
Neither contract A nor contract B have delegate or upgradeable functions.
One of the few things that I have at my disposal to use to my advantage is that contract A has an upgradedividendTracker()
function that results in incorporating a new contract within contract A replacing the current dividend contract, and this occurs without changing the ownership of the original dividend contract.