Compare commits

..

2 Commits

Author SHA1 Message Date
5caa4be03e
feat: add quoter updated event 2025-07-03 10:40:51 +03:00
5189aec53a
fix: fee overwithdraw, bump compiler settings
* use istanbul hardfork
2024-10-29 16:06:09 +03:00
4 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
SOLC = /usr/local/bin/solc
EVM_VERSION = byzantium
SOLC = solc
EVM_VERSION = istanbul
all:
$(SOLC) --bin SwapPool.sol --evm-version $(EVM_VERSION)| awk 'NR>3' > SwapPool.bin

View File

@ -60,6 +60,8 @@ contract SwapPool {
uint256 amountOut
);
event QuoterUpdated(address indexed newQuoter);
constructor(string memory _name, string memory _symbol, uint8 _decimals, address _tokenRegistry, address _tokenLimiter) {
name = _name;
symbol = _symbol;
@ -105,6 +107,7 @@ contract SwapPool {
require(!isSealed(QUOTER_STATE), "ERR_SEAL");
require(msg.sender == owner, "ERR_AXX");
quoter = _quoter;
emit QuoterUpdated(_quoter);
}
// Implements EIP173
@ -251,8 +254,10 @@ contract SwapPool {
bool r;
bytes memory v;
// This is a GE specific feature. However, it can be removed to allow anyone to push fees into a common feeAddress (profit-sharing)
require(msg.sender == owner, "ERR_OWNER");
require(feeAddress != address(0), "ERR_AXX");
require(_value <= fees[_outToken], "ERR_BALANCE");
(r, v) = _outToken.call(abi.encodeWithSignature('transfer(address,uint256)', feeAddress, _value));
require(r, "ERR_TOKEN");