Diff
checker
Texto
Texto
Imagens
Documentos
Excel
Pastas
Legal
Enterprise
Aplicativo para desktop
Preços
Fazer login
Baixar o Diffchecker Desktop
Comparar texto
Encontre a diferença entre dois arquivos de texto
Ferramentas
Histórico
Editor live
Recolher inalteradas
Sem quebra de linha
Layout
Dividido
Unificado
Nível de detalhe
Inteligente
Palavra
Caractere
Realce de sintaxe
Escolher sintaxe
Ignorar
Transformar texto
Ir à primeira mudança
Editar entrada
Diffchecker Desktop
A maneira mais segura de usar o Diffchecker. Obtenha o aplicativo Diffchecker Desktop: seus diffs nunca saem do seu computador!
Obter Desktop
BFactory.sol
Criado
há 6 anos
O diff nunca expira
Limpar
Exportar
Compartilhar
Explicar
5 remoções
Linhas
Total
Removido
Caracteres
Total
Removido
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
80 linhas
Copiar tudo
59 adições
Linhas
Total
Adicionado
Caracteres
Total
Adicionado
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
136 linhas
Copiar tudo
// 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
Diferenças salvas
Texto original
Abrir arquivo
// 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 alterado
Abrir arquivo
// 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 Diferença