PinkyNFT / pinky-contracs

Smart contracts related to v1 Pinky release
0 stars 0 forks source link

add withdrawToken function #8

Open zk1tty opened 5 months ago

zk1tty commented 5 months ago

We only have an withdraw function for native token. https://github.com/PinkyNFT/pinky-contracs/blob/0e842b39bcefeaad0de0900f08ca0516841f619a/contracts/PinkyNFT.sol#L169-L172

But if we support Pinky token payment later, we need to input the withdraw function for Pinky ERC20 token.

function withdrawTokens(address _tokenAddress) external onlyOwner {
    IERC20 token = IERC20(_tokenAddress);
    uint256 balance = token.balanceOf(address(this));
    token.transfer(owner(), balance);
}
toufique-imam commented 4 months ago

How this will work with astar when PinkyToken is only deployed in Polygon, but PinkyNFT is deployed in multiple networks for example Astar

toufique-imam commented 4 months ago

@zk1tty check this commit a0c0402