DummyImplementation.sol 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.7.0;
  3. abstract contract Impl {
  4. function version() public pure virtual returns (string memory);
  5. }
  6. contract DummyImplementation {
  7. uint256 public value;
  8. string public text;
  9. uint256[] public values;
  10. function initializeNonPayable() public {
  11. value = 10;
  12. }
  13. function initializePayable() payable public {
  14. value = 100;
  15. }
  16. function initializeNonPayable(uint256 _value) public {
  17. value = _value;
  18. }
  19. function initializePayable(uint256 _value) payable public {
  20. value = _value;
  21. }
  22. function initialize(uint256 _value, string memory _text, uint256[] memory _values) public {
  23. value = _value;
  24. text = _text;
  25. values = _values;
  26. }
  27. function get() public pure returns (bool) {
  28. return true;
  29. }
  30. function version() public pure virtual returns (string memory) {
  31. return "V1";
  32. }
  33. function reverts() public pure {
  34. require(false);
  35. }
  36. }
  37. contract DummyImplementationV2 is DummyImplementation {
  38. function migrate(uint256 newVal) payable public {
  39. value = newVal;
  40. }
  41. function version() public pure override returns (string memory) {
  42. return "V2";
  43. }
  44. }