Skip to content

Commit

Permalink
use msg.value for initial contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
merklejerk committed Oct 26, 2022
1 parent b2d0886 commit 3b9eac5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/crowdfund/Crowdfund.sol
Expand Up @@ -159,11 +159,11 @@ abstract contract Crowdfund is Implementation, ERC721Receiver, CrowdfundNFT {
splitBps = opts.splitBps;
// If the deployer passed in some ETH during deployment, credit them
// for the initial contribution.
uint96 initialBalance = address(this).balance.safeCastUint256ToUint96();
if (initialBalance > 0) {
uint96 initialContribution = msg.value.safeCastUint256ToUint96();
if (initialContribution > 0) {
// If this contract has ETH, either passed in during deployment or
// pre-existing, credit it to the `initialContributor`.
_contribute(opts.initialContributor, initialBalance, opts.initialDelegate, 0, "");
_contribute(opts.initialContributor, initialContribution, opts.initialDelegate, 0, "");
}
// Set up gatekeeper after initial contribution (initial always gets in).
gateKeeper = opts.gateKeeper;
Expand Down

0 comments on commit 3b9eac5

Please sign in to comment.