contract.js 826 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*global ethereum, MetamaskOnboarding */
  2. /*
  3. The `piggybankContract` is compiled from:
  4. pragma solidity ^0.4.0;
  5. contract PiggyBank {
  6. uint private balance;
  7. address public owner;
  8. function PiggyBank() public {
  9. owner = msg.sender;
  10. balance = 0;
  11. }
  12. function deposit() public payable returns (uint) {
  13. balance += msg.value;
  14. return balance;
  15. }
  16. function withdraw(uint withdrawAmount) public returns (uint remainingBal) {
  17. require(msg.sender == owner);
  18. balance -= withdrawAmount;
  19. msg.sender.transfer(withdrawAmount);
  20. return balance;
  21. }
  22. }
  23. */
  24. const forwarderOrigin = 'http://localhost:9010'
  25. const initialize = () => {
  26. //You will start here
  27. }
  28. window.addEventListener('DOMContentLoaded', initialize)