Skip to content

第三节问题 Mapping 问题 #100

@SongXianYang

Description

@SongXianYang

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; 这个地方有问题 同一个合约账号 在多次支付eth的时候,只保留最后一次 支付的 msg.value

Image

如何解决:userToAountMap[msg.sender] += msg.value;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions