diff --git a/lesson-3/FundMe.sol b/lesson-3/FundMe.sol index 9f9c0c5..da8f0e4 100644 --- a/lesson-3/FundMe.sol +++ b/lesson-3/FundMe.sol @@ -37,7 +37,7 @@ contract FundMe { function fund() external payable { require(convertEthToUsd(msg.value) >= MINIMUM_VALUE, "Send more ETH"); require(block.timestamp < deploymentTimestamp + lockTime, "window is closed"); - fundersToAmount[msg.sender] = msg.value; + fundersToAmount[msg.sender] += msg.value; } function getChainlinkDataFeedLatestAnswer() public view returns (int) { diff --git a/lesson-3/FundMe_flattened.sol b/lesson-3/FundMe_flattened.sol index 105445b..65e09e0 100644 --- a/lesson-3/FundMe_flattened.sol +++ b/lesson-3/FundMe_flattened.sol @@ -61,7 +61,7 @@ contract FundMe { function fund() external payable { require(convertEthToUsd(msg.value) >= MINIMUM_VALUE, "Send more ETH"); require(block.timestamp < deploymentTimestamp + lockTime, "window is closed"); - fundersToAmount[msg.sender] = msg.value; + fundersToAmount[msg.sender] += msg.value; } function getChainlinkDataFeedLatestAnswer() public view returns (int) {