Skip to content

Commit 8ff741b

Browse files
authored
Merge pull request #53 from ambrosus/add-fees-report
Add fees report
2 parents 647b773 + b503831 commit 8ff741b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

contracts/fees/Fees.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ contract Fees is UUPSUpgradeable, AccessControlEnumerableUpgradeable, IFees {
2020

2121
event GasPriceChanged(uint indexed price);
2222
event FeesParamsChanged(address indexed addr, uint indexed percent);
23+
event TxFees(address author, uint256 authorFee, address treasure, uint256 treasureFee);
2324

2425
function initialize(
2526
uint _gasPrice,
@@ -56,5 +57,10 @@ contract Fees is UUPSUpgradeable, AccessControlEnumerableUpgradeable, IFees {
5657
return (payAddress, feePercent);
5758
}
5859

60+
function report(address author, uint256 authorFee, address treasure, uint256 treasureFee) external {
61+
require(msg.sender == block.coinbase, "only block author can call this function");
62+
emit TxFees(author, authorFee, treasure, treasureFee);
63+
}
64+
5965
function _authorizeUpgrade(address) internal override onlyRole(DEFAULT_ADMIN_ROLE) {}
6066
}

contracts/fees/IFees.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ interface IFees {
1414
function getGasPrice() external view returns (uint);
1515
function setFeesParams(address addr, uint percent) external;
1616
function getFeesParams() external view returns (address, uint);
17+
function report(address author, uint256 authorFee, address treasure, uint256 treasureFee) external;
1718
}

scripts/fees/deploy_fees.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function main() {
1616
signer: deployer,
1717
});
1818

19-
const gasPrice = 10;
19+
const gasPrice = 0;
2020
const payAddress = treasure.address;
2121
const feePercent = 300000;
2222

0 commit comments

Comments
 (0)