This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
import "./Background.sol"; | |
contract EntryPoint { | |
address public backgroundAddress; | |
constructor(address _background) public{ | |
backgroundAddress = _background; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
import "truffle/Assert.sol"; | |
import "truffle/DeployedAddresses.sol"; | |
import "../../../contracts/Background.sol"; | |
contract TestBackground { | |
Background public background; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
import "truffle/Assert.sol"; | |
import "truffle/DeployedAddresses.sol"; | |
import "../../../contracts/Background.sol"; | |
import "../../../contracts/EntryPoint.sol"; | |
contract TestEntryPoint { | |
// Ensure that dependency injection working correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
import "truffle/Assert.sol"; | |
import "truffle/DeployedAddresses.sol"; | |
import "../../../contracts/Background.sol"; | |
import "../../../contracts/EntryPoint.sol"; | |
contract TestIntegrationEntryPoint { | |
BackgroundTest public backgroundTest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EntryPoint = artifacts.require("./EntryPoint.sol"); | |
require('chai') | |
.use(require('chai-as-promised')) | |
.should(); | |
contract("EntryPoint", accounts => { | |
describe("Storing Values", () => { | |
it("Stores correctly", async () => { | |
const entryPoint = await EntryPoint.deployed(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyERC20 = artifacts.require("MyERC20"); | |
module.exports = function(deployer) { | |
deployer.deploy(MyERC20); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyERC20 = artifacts.require("MyERC20"); | |
const SecondERC20 = artifacts.require("SecondERC20"); | |
module.exports = function(deployer) { | |
deployer.deploy(MyERC20); | |
deployer.deploy(SecondERC20); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyERC20 = artifacts.require("MyERC20"); | |
const SecondERC20 = artifacts.require("SecondERC20"); | |
module.exports = function(deployer) { | |
// deploy the first | |
deployer.deploy(MyERC20); | |
// get the owner address | |
const accounts = await web3.eth.getAccounts(); | |
const owner = accounts[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyERC20 = artifacts.require("MyERC20"); | |
const Exchange = artifacts.require("Exchange"); | |
module.exports = async function(deployer) { | |
// deploy MyERC20 and store return value | |
let erc20 = await deployer.deploy(MyERC20); | |
// deploy the Exchange and pass erc20 | |
deployer.deploy(Exchange, erc20); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
contract DataTypes { | |
// Boolean | |
bool trueOrFalse; | |
// Unsigned integer. default size is 256 | |
uint firstInteger; | |
// The same as above, with definition | |
uint256 secondInteger; | |
// Signed integer, 128 |