-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ambrosus/staking-part2
Staking part2
- Loading branch information
Showing
22 changed files
with
991 additions
and
274 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.0; | ||
|
||
import "./Finance.sol"; | ||
|
||
|
||
contract Treasury is Finance { | ||
|
||
uint public fee; // in base points (1/10000) | ||
|
||
constructor(address owner, uint _fee) Finance(owner) { | ||
require(_fee <= 10000, "fee is too big"); | ||
fee = _fee; | ||
} | ||
|
||
function setFee(uint _fee) public onlyOwner { | ||
require(_fee <= 10000, "fee is too big"); | ||
fee = _fee; | ||
} | ||
|
||
function calcFee(uint amount) public view returns (uint) { | ||
return amount * fee / 10000; | ||
} | ||
|
||
|
||
// receive and withdraw functions are in Finance contract | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.