title: How to set msg.value in Remix IDE
body: <p>This is probably an easy error I'm missing, but I cannot for the life of me figure out how to set the msg.value variable in this contract. I've read online that this value is the amount of wei associated with the transaction, but how do I, as a caller of the contract, specifically set that value. Here's the contract I'm struggling with.</p>
  <p>pragma solidity 0.8.7;</p>
  <p>contract VendingMachine {</p>
  <pre><code>// Declare state variables of the contract
  address public owner;
  mapping (address =&gt; uint) public cupcakeBalances;
  
  // When 'VendingMachine' contract is deployed:
  // 1. set the deploying address as the owner of the contract
  // 2. set the deployed smart contract's cupcake balance to 100
  constructor() {
      owner = msg.sender;
      cupcakeBalances[address(this)] = 100;
  }
  
  // Allow the owner to increase the smart contract's cupcake balance
  function refill(uint amount) public {
      require(msg.sender == owner, &quot;Only the owner can refill.&quot;);
      cupcakeBalances[address(this)] += amount;
  }
  
  // Allow anyone to purchase cupcakes
  function purchase(uint amount) public payable {
      require(msg.value &gt;= amount * 1 ether, &quot;You must pay at least 1 ETH per cupcake&quot;);
      require(cupcakeBalances[address(this)] &gt;= amount, &quot;Not enough cupcakes in stock to complete this purchase&quot;);
      cupcakeBalances[address(this)] -= amount;
      cupcakeBalances[msg.sender] += amount;
  }
  </code></pre>
  <p>}</p>
  <p>Every time I enter an amount, I'm getting thrown the error that says &quot;You must pay at least 1 ETH per cupcake&quot;</p>
  <p>There's nowhere for me to specifically enter in a value for how much I'm going to pay for this, any help would be great</p>
  <p><a href="https://i.stack.imgur.com/N3Pne.png" rel="nofollow noreferrer">here's what I'm able to input when I deploy the contract on Remix</a></p>