Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
BFactory.sol
Creado
hace 6 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
5 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
80 líneas
Copiar todo
59 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
136 líneas
Copiar todo
// 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
);
);
Copiar
Copiado
Copiar
Copiado
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)
{
{
Copiar
Copiado
Copiar
Copiado
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;
Copiar
Copiado
Copiar
Copiado
address private _reservesAddress;
bool private _allowNonAdminPool;
constructor() public {
constructor() public {
_blabs = msg.sender;
_blabs = msg.sender;
Copiar
Copiado
Copiar
Copiado
_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
{
{
Copiar
Copiado
Copiar
Copiado
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;
}
}
Copiar
Copiado
Copiar
Copiado
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)
Copiar
Copiado
Copiar
Copiado
external
external
{
{
Copiar
Copiado
Copiar
Copiado
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);
Copiar
Copiado
Copiar
Copiado
require(xfer
, "ERR_ERC20_FAILED");
require(xfer
);
}
function collectTokenReserves(BPool pool)
external
{
require(msg.sender == _blabs);
require(_isBPool[address(pool)]);
pool.drainTotalReserves(_reservesAddress);
}
}
}
}
Copiar
Copiado
Copiar
Copiado
Diferencias guardadas
Texto original
Abrir archivo
// 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"); } }
Texto modificado
Abrir archivo
// 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); } }
Encontrar la diferencia