DappHero Docs
  • Getting Started 👋🏽
  • DappHero Basics
    • How does it work? 🧐
    • Setting Up Your Project 🏗️
      • Projects
      • Smart Contracts
    • An Intro to Features 🎁
  • Features
    • Network ⛓️
    • User 🤖
    • 3box 👯‍♂️
    • Smart Contracts 👩🏾‍🔬
      • Adding Smart Contracts 🏗️
        • Contract Details
      • Create a Method Instance
      • Inputs
      • Invoke
      • Outputs
      • Events
      • Advanced: Automatically clearing Inputs
      • Advanced: Getting the Current User's Address Dynamically
      • Advanced: Sending ETH to a contract method
      • Listening to Events
      • Resources: Learn More
      • Resources: Test Contracts
    • Collectibles 🃏
      • Getting Started
      • Single Collectibles
      • Listing Collectibles
      • Displaying Token Metadata
      • Advanced: $CURRENT_USER
      • Advanced: $URL
      • Advanced: $THIS
      • Advanced: Properties
      • Calling Smart Contracts inside Collectibles
      • Collectible Example
  • No-Code Integrations
    • Webflow 🎁
      • Getting Started with Webflow
      • Add DappHero Elements
      • Learn more about WebFlow
  • Examples
    • Coming soon...
  • Advanced
    • Engine Events
    • Force Refresh
    • Database
    • Ethereum Provider
  • Updates
    • ChangeLog
  • Bug Bounty
Powered by GitBook
On this page
  • Kovan:
  • Goerli:

Was this helpful?

  1. Features
  2. Smart Contracts 👩🏾‍🔬

Resources: Test Contracts

Want to practice your skills? We have the tools for you!

PreviousResources: Learn MoreNextCollectibles 🃏

Last updated 5 years ago

Was this helpful?

To help test that you're accessing your smart contracts in the correct way, we have created and deployed a number of test contracts to all the major networks to allow you to test against:

Mainnet:

Ropsten:

Rinkeby:

Kovan:

Goerli:

xDai:

GithubGist:

Solidity Code:

pragma solidity 0.5.0;

contract DappHeroTest {
    uint public important = 777;
    bytes32 public hello = "Howdy";
    
    address public owner;
    
    event EventTrigger(address indexed sender, uint value);
    event ValueSent(address indexed sender);
    event EmitString(string message);
    event ValueSentWithMessage(address indexed sender, bytes32 message);

    constructor() public {
       owner = msg.sender;
    }

    function viewNoArgsMultipleReturn() public view returns(uint importantNumber, bytes32 sayHello){
        return (
            importantNumber,
            hello
        );
    }
    
    function viewMultipleArgsSingleReturn(address fromAddress, uint amount) public view returns(uint singleInt){
        return 89898989;
    }
    
    function viewMultipleArgsMultipleReturn(address fromAddress, uint amount) public view returns(uint longInteger, bytes32 sayHello){
        return (
            8989898989,
            hello
        );
    }

    function triggerEvent(uint anyInputValue) public {
        emit EventTrigger (msg.sender, 10);
    }

    function sendEthNoArgs() public payable {
        emit ValueSent(msg.sender);
        msg.sender.transfer(msg.value);
    }
    
    function makeTxNoArgs() public {
        emit EventTrigger(msg.sender, important);
    }
    
    function makeTxWithArgs(string memory myString) public {
        emit EmitString(myString);
    }

    function sendEthWithArgs(bytes32 simpleMessage) public payable {
        emit ValueSentWithMessage(msg.sender, "message");
        msg.sender.transfer(msg.value);
    }

    function sendMinimumTwoEthNoArgs() public payable {
        require(msg.value >= 2);
        emit ValueSent(msg.sender);
        msg.sender.transfer(msg.value);
    }

    function sendMinimumTwoEthWithArgs(bytes32 message) public payable {
        require(msg.value >= 2);
        emit ValueSentWithMessage(msg.sender, message);
        msg.sender.transfer(msg.value);
    }
}

ABI:

https://etherscan.io/address/0x29f7324836a88d04ce760e240e6cd7f0780aa255#code
https://ropsten.etherscan.io/address/0xe2a6dd166b1840db90b2e4462ca7a90187562ddc#code
https://rinkeby.etherscan.io/address/0x6eefcb4ea22ed10f0094e0e6a8076275c7422220#code
https://kovan.etherscan.io/address/0x08c64b4d01881e29c5f4a8454de7e29ec395b544#code
https://goerli.etherscan.io/address/0x08c64b4d01881e29c5f4a8454de7e29ec395b544#code
https://gist.github.com/crazyrabbitLTC/ed45a52cdcc559feb6ac5703ee93c8b2
https://gist.github.com/crazyrabbitLTC/e4432070cd41b6f7181f3935d260871e