Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/PoolStreamer2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ contract PoolStreamer2 is AccessControl {
// downgrade amount from super token to underlying token
_superToken(pool).downgrade(amount);
// transfer amount to msg.sender
_superToken(pool).transfer(msg.sender, amount);
_underlyingToken(pool).transfer(msg.sender, amount);
}

function superToken(ISuperFluidPool pool) external view returns (address) {
Expand Down Expand Up @@ -288,4 +288,4 @@ contract PoolStreamer2 is AccessControl {
}

}


3 changes: 2 additions & 1 deletion contracts/Streamonomics.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ contract Streamonomics is Ownable {
delete streamonomics;
uint256 total;
for(uint i = 0; i < percentage.length; i++) {
require(step[i] > 0, "!step");
streamonomics.push(Streamonomic(percentage[i], start[i], step[i], limit[i]));
emit StreamonomicAdded(percentage[i], start[i], step[i], limit[i]);
total += percentage[i];
Expand All @@ -43,4 +44,4 @@ contract Streamonomics is Ownable {
return streamonomics;
}

}
}
18 changes: 18 additions & 0 deletions test/streamonomics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { expect } = require("chai");
const { ethers } = require("hardhat");

describe("Streamonomics", function () {
it("reverts when step is zero", async function () {
const Streamonomics = await ethers.getContractFactory("Streamonomics");
const stream = await Streamonomics.deploy();
await stream.deployed();

const percentage = [10];
const start = [1];
const step = [0];
const limit = [1];

await expect(stream.setStreamonomics(percentage, start, step, limit))
.to.be.revertedWith("!step");
});
});