i am having error payable funtion is not working

Viewed 12

pragma solidity ^0.8.7; // SPDX-License-Identifier: MIT contract FeeCollector {//hidden keys address public owner; uint256 public balance; constructor () { owner = msg.sender; } receive () payable external { balance += msg.value; } function withdraw (uint amount, ...

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract PriceConsumerV3 {

    AggregatorV3Interface internal priceFeed;

    /**
     * Network: Goerli
     * Aggregator: ETH/USD
     * Address: 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e
     */
    constructor() {
        priceFeed = AggregatorV3Interface(0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e);
    }

    /**
     * Returns the latest price
     */
    function getLatestPrice() public view returns (int) {
        (
            /*uint80 roundID*/,
            int price,
            /*uint startedAt*/,
            /*uint timeStamp*/,
            /*uint80 answeredInRound*/
        ) = priceFeed.latestRoundData();
        return price;
    }
}

i am having trousjkdhkjh hjk hkjhjkhjkh kj jhh jk h

0 Answers
Related