Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
BFactory.sol
Created
6 years ago
Diff never expires
Clear
Export
Share
Explain
5 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
80 lines
Copy
59 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
136 lines
Copy
// This program is free software: you can redistribute it and/or modify
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
// This program is disstributed in the hope that it will be useful,
// This program is disstributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
pragma solidity 0.5.12;
// Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)`
// Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)`
import "./BPool.sol";
import "./BPool.sol";
contract BFactory is BBronze {
contract BFactory is BBronze {
event LOG_NEW_POOL(
event LOG_NEW_POOL(
address indexed caller,
address indexed caller,
address indexed pool
address indexed pool
);
);
event LOG_BLABS(
event LOG_BLABS(
address indexed caller,
address indexed caller,
address indexed blabs
address indexed blabs
);
);
Copy
Copied
Copy
Copied
event LOG_RESERVES_ADDRESS(
address indexed caller,
address indexed reservesAddress
);
event LOG_ALLOW_NON_ADMIN_POOL(
address indexed caller,
bool allow
);
mapping(address=>bool) private _isBPool;
mapping(address=>bool) private _isBPool;
function isBPool(address b)
function isBPool(address b)
external view returns (bool)
external view returns (bool)
{
{
return _isBPool[b];
return _isBPool[b];
}
}
function newBPool()
function newBPool()
external
external
returns (BPool)
returns (BPool)
{
{
Copy
Copied
Copy
Copied
if (!_allowNonAdminPool) {
require(msg.sender == _blabs);
}
BPool bpool = new BPool();
BPool bpool = new BPool();
_isBPool[address(bpool)] = true;
_isBPool[address(bpool)] = true;
emit LOG_NEW_POOL(msg.sender, address(bpool));
emit LOG_NEW_POOL(msg.sender, address(bpool));
bpool.setController(msg.sender);
bpool.setController(msg.sender);
return bpool;
return bpool;
}
}
address private _blabs;
address private _blabs;
Copy
Copied
Copy
Copied
address private _reservesAddress;
bool private _allowNonAdminPool;
constructor() public {
constructor() public {
_blabs = msg.sender;
_blabs = msg.sender;
Copy
Copied
Copy
Copied
_reservesAddress = msg.sender;
_allowNonAdminPool = false;
}
function getAllowNonAdminPool()
external view
returns (bool)
{
return _allowNonAdminPool;
}
function setAllowNonAdminPool(bool b)
external
{
require(msg.sender == _blabs, "ERR_NOT_BLABS");
emit LOG_ALLOW_NON_ADMIN_POOL(msg.sender, b);
_allowNonAdminPool = b;
}
}
function getBLabs()
function getBLabs()
external view
external view
returns (address)
returns (address)
{
{
return _blabs;
return _blabs;
}
}
function setBLabs(address b)
function setBLabs(address b)
external
external
{
{
Copy
Copied
Copy
Copied
require(msg.sender == _blabs
, "ERR_NOT_BLABS"
);
require(msg.sender == _blabs
);
emit LOG_BLABS(msg.sender, b);
emit LOG_BLABS(msg.sender, b);
_blabs = b;
_blabs = b;
}
}
Copy
Copied
Copy
Copied
function getReservesAddress()
external view
returns (address)
{
return _reservesAddress;
}
function setReservesAddress(address a)
external
{
require(msg.sender == _blabs);
emit LOG_RESERVES_ADDRESS(msg.sender, a);
_reservesAddress = a;
}
function collect(BPool pool)
function collect(BPool pool)
Copy
Copied
Copy
Copied
external
external
{
{
Copy
Copied
Copy
Copied
require(msg.sender == _blabs
, "ERR_NOT_BLABS"
);
require(msg.sender == _blabs
);
require(_isBPool[address(pool)]
);
uint collected = IERC20(pool).balanceOf(address(this));
uint collected = IERC20(pool).balanceOf(address(this));
bool xfer = pool.transfer(_blabs, collected);
bool xfer = pool.transfer(_blabs, collected);
Copy
Copied
Copy
Copied
require(xfer
, "ERR_ERC20_FAILED");
require(xfer
);
}
function collectTokenReserves(BPool pool)
external
{
require(msg.sender == _blabs);
require(_isBPool[address(pool)]);
pool.drainTotalReserves(_reservesAddress);
}
}
}
}
Copy
Copied
Copy
Copied
Saved diffs
Original text
Open file
// This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is disstributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity 0.5.12; // Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)` import "./BPool.sol"; contract BFactory is BBronze { event LOG_NEW_POOL( address indexed caller, address indexed pool ); event LOG_BLABS( address indexed caller, address indexed blabs ); mapping(address=>bool) private _isBPool; function isBPool(address b) external view returns (bool) { return _isBPool[b]; } function newBPool() external returns (BPool) { BPool bpool = new BPool(); _isBPool[address(bpool)] = true; emit LOG_NEW_POOL(msg.sender, address(bpool)); bpool.setController(msg.sender); return bpool; } address private _blabs; constructor() public { _blabs = msg.sender; } function getBLabs() external view returns (address) { return _blabs; } function setBLabs(address b) external { require(msg.sender == _blabs, "ERR_NOT_BLABS"); emit LOG_BLABS(msg.sender, b); _blabs = b; } function collect(BPool pool) external { require(msg.sender == _blabs, "ERR_NOT_BLABS"); uint collected = IERC20(pool).balanceOf(address(this)); bool xfer = pool.transfer(_blabs, collected); require(xfer, "ERR_ERC20_FAILED"); } }
Changed text
Open file
// This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is disstributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity 0.5.12; // Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)` import "./BPool.sol"; contract BFactory is BBronze { event LOG_NEW_POOL( address indexed caller, address indexed pool ); event LOG_BLABS( address indexed caller, address indexed blabs ); event LOG_RESERVES_ADDRESS( address indexed caller, address indexed reservesAddress ); event LOG_ALLOW_NON_ADMIN_POOL( address indexed caller, bool allow ); mapping(address=>bool) private _isBPool; function isBPool(address b) external view returns (bool) { return _isBPool[b]; } function newBPool() external returns (BPool) { if (!_allowNonAdminPool) { require(msg.sender == _blabs); } BPool bpool = new BPool(); _isBPool[address(bpool)] = true; emit LOG_NEW_POOL(msg.sender, address(bpool)); bpool.setController(msg.sender); return bpool; } address private _blabs; address private _reservesAddress; bool private _allowNonAdminPool; constructor() public { _blabs = msg.sender; _reservesAddress = msg.sender; _allowNonAdminPool = false; } function getAllowNonAdminPool() external view returns (bool) { return _allowNonAdminPool; } function setAllowNonAdminPool(bool b) external { require(msg.sender == _blabs, "ERR_NOT_BLABS"); emit LOG_ALLOW_NON_ADMIN_POOL(msg.sender, b); _allowNonAdminPool = b; } function getBLabs() external view returns (address) { return _blabs; } function setBLabs(address b) external { require(msg.sender == _blabs); emit LOG_BLABS(msg.sender, b); _blabs = b; } function getReservesAddress() external view returns (address) { return _reservesAddress; } function setReservesAddress(address a) external { require(msg.sender == _blabs); emit LOG_RESERVES_ADDRESS(msg.sender, a); _reservesAddress = a; } function collect(BPool pool) external { require(msg.sender == _blabs); require(_isBPool[address(pool)]); uint collected = IERC20(pool).balanceOf(address(this)); bool xfer = pool.transfer(_blabs, collected); require(xfer); } function collectTokenReserves(BPool pool) external { require(msg.sender == _blabs); require(_isBPool[address(pool)]); pool.drainTotalReserves(_reservesAddress); } }
Find difference