I wonder how can I natively pop-up the MetaMask window to send specific amount of ether as a donation to already defined SC address and ABI?
Short code intro:
pragma solidity >=0.7.0 <0.8.6;
[...]
receive() external payable minumum_donation_amount(msg.value) {
OWNER.transfer(msg.value);
donated_people[how_many_people_donated+1] = DonatedPeople(msg.sender, block.timestamp, msg.value);
how_many_people_donated++;
emit SubscribeDonatedPeople(msg.sender, block.timestamp, msg.value);
}
modifier minumum_donation_amount(uint256 amount) {
require(amount >= 0.0005 ether, "The minumum donation amount is 0.0005 Ether");
_;
}
[...]
Successfully getting data from SC to JavaScript console with web3 anonymous function like this:
(function () {
CONTRACT.methods.donated_people(1).call().then( function( donated ) {
console.log(donated);
});
})();
I can send ether by hard coding the SC address and from/to address. However, I would like to get the ether from contract method directly to native receive function which has modifier to minimum amount. From Remix we are calling "Low level interactions" like this:
Any ideas how to achieve the same results in web3 like in Remix? Thanks in advance!