fix
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
- contracts/external/ERC1155/
|
||||
|
||||
- contracts/external/ERC20/InitializableERC20.sol
|
||||
|
||||
- contracts/Factory/Registries/
|
||||
|
||||
- contracts/Factory/NFTTokenFactory.sol
|
||||
|
||||
@@ -63,9 +63,9 @@ module.exports = {
|
||||
|
||||
//================== NFT ====================
|
||||
ConstFeeRateModel: "0xBDAcEcF886a4F0C509260d9678D5673C3E8fa4b7",
|
||||
FeeDistributor: "0x989F9eFaA19c6A06945Db4439b9a7935dD573A66",
|
||||
Fragment: "0x36ed21f19B0cf0c1E571A8C3A6953a5778E48B5a",
|
||||
NFTCollateralVault: "0x5a317a617FBF89d55bBfe40A76E526FCD74E4545",
|
||||
FeeDistributor: "0x1eD92Fe9c3AE1cC427004eC27AAd96df4928B3ec",
|
||||
Fragment: "0x64193839f8b6e85A257411a945085783cbA9976B",
|
||||
NFTCollateralVault: "0xFDf7604649dfBb733e784afAEdC19892706cc683",
|
||||
DODONFTRouteHelper: "0xAE683548702be6d651e179e5F9313272bb18596A",
|
||||
|
||||
InitializableERC721: "0x7563414479593394460d1bbaFE2Fc3E29D804007",
|
||||
@@ -73,6 +73,6 @@ module.exports = {
|
||||
NFTTokenFactory: "0x38c109aF4f3454172BA4eecf5676aA213b589e75",
|
||||
|
||||
DODONFTRegistry: "0xF405372b7808363DCfbb5Eb81204889B7a69Aa3e",
|
||||
DODONFTProxy: "0x41c5eDe987bd61c75925Ab2657256D75270a55D4",
|
||||
DODONFTProxy: "0x622332C5e5B3E8B67Aee300184Ce024E428A89f8",
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, IERC1155Re
|
||||
// ============ Event ============
|
||||
event RemoveNftToken(address nftContract, uint256 tokenId, uint256 amount);
|
||||
event AddNftToken(address nftContract, uint256 tokenId, uint256 amount);
|
||||
event CreateFragment();
|
||||
|
||||
|
||||
// ============ Ownable ============
|
||||
@@ -55,10 +54,9 @@ contract NFTCollateralVault is InitializableOwnable, IERC721Receiver, IERC1155Re
|
||||
function createFragment(address nftProxy, bytes calldata data) external preventReentrant onlyOwner {
|
||||
require(nftProxy != address(0), "DODONftVault: PROXY_INVALID");
|
||||
_OWNER_ = nftProxy;
|
||||
nftProxy.call(data);
|
||||
// require(success, "DODONftVault: TRANSFER_OWNER_FAILED");
|
||||
(bool success,) = nftProxy.call(data);
|
||||
require(success, "DODONftVault: TRANSFER_OWNER_FAILED");
|
||||
emit OwnershipTransferred(_OWNER_, nftProxy);
|
||||
emit CreateFragment();
|
||||
}
|
||||
|
||||
function withdrawERC721(address nftContract, uint256 tokenId) external onlyOwner {
|
||||
|
||||
@@ -136,6 +136,7 @@ contract FeeDistributor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
contract StakeVault is Ownable {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
@@ -144,6 +145,8 @@ contract StakeVault is Ownable {
|
||||
uint256 amount,
|
||||
address to
|
||||
) external onlyOwner {
|
||||
IERC20(token).safeTransfer(to, amount);
|
||||
if (amount > 0) {
|
||||
IERC20(token).safeTransfer(to, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ contract Fragment is InitializableERC20 {
|
||||
|
||||
// init FRAG distribution
|
||||
uint256 vaultPreOwnerBalance = DecimalMath.mulFloor(totalSupply, ownerRatio);
|
||||
transfer(_VAULT_PRE_OWNER_,vaultPreOwnerBalance);
|
||||
transfer(_DVM_,totalSupply.sub(vaultPreOwnerBalance));
|
||||
_transfer(address(this), _VAULT_PRE_OWNER_, vaultPreOwnerBalance);
|
||||
_transfer(address(this), _DVM_, totalSupply.sub(vaultPreOwnerBalance));
|
||||
|
||||
// init DVM liquidity
|
||||
IDVM(_DVM_).buyShares(address(this));
|
||||
|
||||
19
contracts/external/ERC20/InitializableERC20.sol
vendored
19
contracts/external/ERC20/InitializableERC20.sol
vendored
@@ -43,12 +43,7 @@ contract InitializableERC20 {
|
||||
}
|
||||
|
||||
function transfer(address to, uint256 amount) public returns (bool) {
|
||||
require(to != address(0), "TO_ADDRESS_IS_EMPTY");
|
||||
require(amount <= balances[msg.sender], "BALANCE_NOT_ENOUGH");
|
||||
|
||||
balances[msg.sender] = balances[msg.sender].sub(amount);
|
||||
balances[to] = balances[to].add(amount);
|
||||
emit Transfer(msg.sender, to, amount);
|
||||
_transfer(msg.sender, to, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,4 +76,16 @@ contract InitializableERC20 {
|
||||
function allowance(address owner, address spender) public view returns (uint256) {
|
||||
return allowed[owner][spender];
|
||||
}
|
||||
|
||||
function _transfer(address sender, address recipient, uint256 amount) internal {
|
||||
require(sender != address(0), "FROM_ADDRESS_IS_EMPTY");
|
||||
require(recipient != address(0), "TO_ADDRESS_IS_EMPTY");
|
||||
require(amount <= balances[sender], "BALANCE_NOT_ENOUGH");
|
||||
|
||||
balances[sender] = balances[sender].sub(amount);
|
||||
balances[recipient] = balances[recipient].add(amount);
|
||||
|
||||
emit Transfer(sender, recipient, amount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,3 +58,65 @@ DODONFTProxyAddress: 0x41c5eDe987bd61c75925Ab2657256D75270a55D4
|
||||
Init DODONFTProxyAddress Tx: 0x8193cc72ebbc27e024d44f25cad6bb74def48130339f4ab589989dbb6a157ad6
|
||||
DODOApproveProxy unlockAddProxy tx: 0xef8154df211142848d99cbd5c80410ca32fa4503b9715642aa463c0d77aecdc8
|
||||
DODOApproveProxy addDODOProxy tx: 0x01ec3075e3bc5a27f2cd8eeb0a8d86b2aad7f80981fd48fc6fcb3bc527ebcb61
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午3:19:16
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午3:21:20
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午3:41:52
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午3:43:55
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: kovan
|
||||
Deploy time: 2021/4/9 下午3:49:14
|
||||
Deploy type: NFT
|
||||
multiSigAddress: 0x7e83d9d94837eE82F0cc18a691da6f42F03F1d86
|
||||
NFTCollateralVaultAddress: 0xbB1019A1c549b87902347F660b9Db554aA2D508b
|
||||
FeeDistributorAddress: 0x32B7D9d82e97A8957c9e84E30788972EDECc83A3
|
||||
DODONFTProxyAddress: 0xeD662e5391a3aA6F2FF610a5b33c62815b342B35
|
||||
Init DODONFTProxyAddress Tx: 0xf5e62a74e1ccbb00fb30eef1884756306df8ffa3bb22cea51fd470c635101a23
|
||||
DODOApproveProxy unlockAddProxy tx: 0xe0c84e14d6bba1b9217f40ec6b743204076226c76ce18cbc26811cb8815c9f15
|
||||
DODOApproveProxy addDODOProxy tx: 0x989210ec5ac5ffbf317803bd4127d0189430c7a287f68331ba6185185af41b85
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午4:20:36
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: kovan
|
||||
Deploy time: 2021/4/9 下午5:33:29
|
||||
Deploy type: NFT
|
||||
multiSigAddress: 0x7e83d9d94837eE82F0cc18a691da6f42F03F1d86
|
||||
FragmentAddress: 0x2beB90080b86fc107C01a5C321cC8AB078a91c9e
|
||||
DODOApproveProxy unlockAddProxy tx: 0x55a31f4e8c4f9957a4505c5d14abfc7e4d01dfe9043d07d10a449e07211ba086
|
||||
DODOApproveProxy addDODOProxy tx: 0xb36c40244cb9c4f177ae2c5524a5d6ebde0d10c0a8683a2fb202ea50429bcb4f
|
||||
====================================================
|
||||
network type: development
|
||||
Deploy time: 2021/4/9 下午5:39:03
|
||||
Deploy type: NFT
|
||||
multiSigAddress: undefined
|
||||
====================================================
|
||||
network type: kovan
|
||||
Deploy time: 2021/4/9 下午8:00:59
|
||||
Deploy type: NFT
|
||||
multiSigAddress: 0x7e83d9d94837eE82F0cc18a691da6f42F03F1d86
|
||||
NFTCollateralVaultAddress: 0xFDf7604649dfBb733e784afAEdC19892706cc683
|
||||
FragmentAddress: 0x64193839f8b6e85A257411a945085783cbA9976B
|
||||
FeeDistributorAddress: 0x1eD92Fe9c3AE1cC427004eC27AAd96df4928B3ec
|
||||
DODONFTProxyAddress: 0x622332C5e5B3E8B67Aee300184Ce024E428A89f8
|
||||
Init DODONFTProxyAddress Tx: 0xdd8137f026d229e5d0ab796677627479896a38b065f6eb03f6be3e4f615e900a
|
||||
DODOApproveProxy unlockAddProxy tx: 0x68dcc65b77711dd5445d6bb0cf6710d45eb0fe17fa2bd9b9b240d8163dc8ea34
|
||||
DODOApproveProxy addDODOProxy tx: 0x4e5a77d040cdec2e62534fd16150e0c6a3375dbf3122c1a95d04625fdf4e9b89
|
||||
Add AdminList on DODONFTRegistry Tx: 0x7d84c1128c6f6779307df1d4c7e12f10353b78d1f520aecb5cafcb0218c57c58
|
||||
|
||||
@@ -161,6 +161,10 @@ module.exports = async (deployer, network, accounts) => {
|
||||
|
||||
tx = await DODOApproveProxyInstance.addDODOProxy();
|
||||
logger.log("DODOApproveProxy addDODOProxy tx: ", tx.tx);
|
||||
|
||||
const DODONFTRegistrynstance = await DODONFTRegistry.at(DODONFTRegistryAddress);
|
||||
var tx = await DODONFTRegistrynstance.addAmindList(DODONFTProxyAddress);
|
||||
logger.log("Add AdminList on DODONFTRegistry Tx:", tx.tx);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -92,9 +92,12 @@ describe("DODONFT", () => {
|
||||
var erc721Instance = contracts.getContractWithAddress(contracts.ERC721, erc721Address);
|
||||
await erc721Instance.methods.safeTransferFrom(author, vaultAddress, 0).send(ctx.sendParam(author));
|
||||
|
||||
var quoteToken = ctx.USDT.options.address;
|
||||
var vaultPreOwner = author;
|
||||
var stakeToken = "0x0000000000000000000000000000000000000000";
|
||||
var quoteToken = "0x156595bAF85D5C29E91d959889B022d952190A64";
|
||||
var vaultPreOwner = "0xaac153c1344cA14497A5dd22b1F70C28793625aa";
|
||||
var stakeToken = "0x854b0f89BAa9101e49Bfb357A38071C9db5d0DFa";
|
||||
// var quoteToken = ctx.USDT.options.address;
|
||||
// var vaultPreOwner = author;
|
||||
// var stakeToken = "0x0000000000000000000000000000000000000000";
|
||||
var dvmParams = [
|
||||
"0",
|
||||
"10000000000000000",
|
||||
@@ -117,10 +120,12 @@ describe("DODONFT", () => {
|
||||
).encodeABI();
|
||||
console.log("data:",callData);
|
||||
|
||||
await logGas(await nftVaultInstance.methods.createFragment(
|
||||
ctx.NFTProxy.options.address,
|
||||
callData
|
||||
), ctx.sendParam(author), "createFragment");
|
||||
// var tx = await logGas(await nftVaultInstance.methods.createFragment(
|
||||
// ctx.NFTProxy.options.address,
|
||||
// callData
|
||||
// ), ctx.sendParam(author), "createFragment");
|
||||
|
||||
// console.log("tx:",tx);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
truffle compile --all
|
||||
# truffle compile --all
|
||||
|
||||
if [ "$1"x = "proxy-dpp"x ]
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user