-
Notifications
You must be signed in to change notification settings - Fork 0
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 MoonSHRD/refactor/getters
Refactor/getters
- Loading branch information
Showing
21 changed files
with
685 additions
and
85 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
artifacts/contracts/CurrenciesERC20.sol/CurrenciesERC20.dbg.json
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../build-info/619187956ce695f2b317596a966187a7.json" | ||
"buildInfo": "../../build-info/b23dcfaa16e52cbf3213a37041bb8b66.json" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
artifacts/contracts/FeesCalculator.sol/FeesCalculator.dbg.json
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,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../build-info/f67bdb8d1ba28198b20d62c2e1663fbc.json" | ||
} |
40 changes: 40 additions & 0 deletions
40
artifacts/contracts/FeesCalculator.sol/FeesCalculator.json
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,40 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "FeesCalculator", | ||
"sourceName": "contracts/FeesCalculator.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "amount", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "scale", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "promille_fee_", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "calculateAbstractFee", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "pure", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x6103bc610053600b82828239805160001a607314610046577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806336ea61781461003a575b600080fd5b610054600480360381019061004f9190610148565b61006a565b60405161006191906101a6565b60405180910390f35b60008083856100799190610217565b90506000848661008991906102e0565b9050600085856100999190610217565b9050600086866100a991906102e0565b90508660018883866100bb9190610248565b6100c591906101c1565b6100cf91906102a2565b6100d99190610217565b82846100e59190610248565b82866100f19190610248565b8985886100fe9190610248565b6101089190610248565b61011291906101c1565b61011c91906101c1565b61012691906101c1565b9450505050509392505050565b6000813590506101428161036f565b92915050565b60008060006060848603121561015d57600080fd5b600061016b86828701610133565b935050602061017c86828701610133565b925050604061018d86828701610133565b9150509250925092565b6101a0816102d6565b82525050565b60006020820190506101bb6000830184610197565b92915050565b60006101cc826102d6565b91506101d7836102d6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561020c5761020b610311565b5b828201905092915050565b6000610222826102d6565b915061022d836102d6565b92508261023d5761023c610340565b5b828204905092915050565b6000610253826102d6565b915061025e836102d6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561029757610296610311565b5b828202905092915050565b60006102ad826102d6565b91506102b8836102d6565b9250828210156102cb576102ca610311565b5b828203905092915050565b6000819050919050565b60006102eb826102d6565b91506102f6836102d6565b92508261030657610305610340565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b610378816102d6565b811461038357600080fd5b5056fea264697066735822122061f11dcb80709bea7eaf31c9dd8ddbf388f7ed6c6e6932d47b6fcbf7d786742a64736f6c63430008040033", | ||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806336ea61781461003a575b600080fd5b610054600480360381019061004f9190610148565b61006a565b60405161006191906101a6565b60405180910390f35b60008083856100799190610217565b90506000848661008991906102e0565b9050600085856100999190610217565b9050600086866100a991906102e0565b90508660018883866100bb9190610248565b6100c591906101c1565b6100cf91906102a2565b6100d99190610217565b82846100e59190610248565b82866100f19190610248565b8985886100fe9190610248565b6101089190610248565b61011291906101c1565b61011c91906101c1565b61012691906101c1565b9450505050509392505050565b6000813590506101428161036f565b92915050565b60008060006060848603121561015d57600080fd5b600061016b86828701610133565b935050602061017c86828701610133565b925050604061018d86828701610133565b9150509250925092565b6101a0816102d6565b82525050565b60006020820190506101bb6000830184610197565b92915050565b60006101cc826102d6565b91506101d7836102d6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561020c5761020b610311565b5b828201905092915050565b6000610222826102d6565b915061022d836102d6565b92508261023d5761023c610340565b5b828204905092915050565b6000610253826102d6565b915061025e836102d6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561029757610296610311565b5b828202905092915050565b60006102ad826102d6565b91506102b8836102d6565b9250828210156102cb576102ca610311565b5b828203905092915050565b6000819050919050565b60006102eb826102d6565b91506102f6836102d6565b92508261030657610305610340565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b610378816102d6565b811461038357600080fd5b5056fea264697066735822122061f11dcb80709bea7eaf31c9dd8ddbf388f7ed6c6e6932d47b6fcbf7d786742a64736f6c63430008040033", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/contracts/MetaMarketplace.sol/MetaMarketplace.dbg.json
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../build-info/619187956ce695f2b317596a966187a7.json" | ||
"buildInfo": "../../build-info/b23dcfaa16e52cbf3213a37041bb8b66.json" | ||
} |
156 changes: 134 additions & 22 deletions
156
artifacts/contracts/MetaMarketplace.sol/MetaMarketplace.json
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
artifacts/contracts/interfaces/ICurrenciesERC20.sol/ICurrenciesERC20.dbg.json
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../build-info/619187956ce695f2b317596a966187a7.json" | ||
"buildInfo": "../../../build-info/7f5e4a5ac7db7775e3609208f4790b27.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/contracts/interfaces/IMetaMarketplace.sol/IMetaMarketplace.dbg.json
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../build-info/619187956ce695f2b317596a966187a7.json" | ||
"buildInfo": "../../../build-info/b23dcfaa16e52cbf3213a37041bb8b66.json" | ||
} |
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,25 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
|
||
/** | ||
* @author Jack Bekket | ||
* ALL RIGHTS RESERVED | ||
*/ | ||
library FeesCalculator { | ||
|
||
/** | ||
* Calculate fee (UnSafeMath) -- use it only if it ^0.8.0 | ||
* @dev calculate fee | ||
* @param amount number from whom we take fee | ||
* @param scale scale for rounding. 100 is 1/100 (percent). we can encreace scale if we want better division (like we need to take 0.5% instead of 5%, then scale = 1000) | ||
*/ | ||
function calculateAbstractFee(uint256 amount, uint256 scale, uint256 promille_fee_) public pure returns(uint256) { | ||
uint a = amount / scale; | ||
uint b = amount % scale; | ||
uint c = promille_fee_ / scale; | ||
uint d = promille_fee_ % scale; | ||
return a * c * scale + a * d + b * c + (b * d + scale - 1) / scale; | ||
} | ||
} |
Oops, something went wrong.
54f8313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
telegram-nft-marketplace – ./
telegram-nft-marketplace-git-master-s0lidarnost.vercel.app
telegram-nft-marketplace.vercel.app
telegram-nft-marketplace-s0lidarnost.vercel.app