fix idvm interface
This commit is contained in:
@@ -101,7 +101,7 @@ contract CPFunding is CPStorage {
|
||||
_transferBaseOut(_POOL_, poolBase);
|
||||
_transferQuoteOut(_POOL_, poolQuote);
|
||||
|
||||
_TOTAL_LP_AMOUNT_ = IDVM(_POOL_).buyShares(address(this));
|
||||
(_TOTAL_LP_AMOUNT_, ,) = IDVM(_POOL_).buyShares(address(this));
|
||||
|
||||
msg.sender.transfer(_SETTEL_FUND_);
|
||||
|
||||
|
||||
@@ -91,6 +91,6 @@ contract DVM is DVMTrader, DVMFunding {
|
||||
// ============ Version Control ============
|
||||
|
||||
function version() external pure returns (string memory) {
|
||||
return "DVM 1.0.1";
|
||||
return "DVM 1.0.2";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ contract DVMVault is DVMStorage {
|
||||
}
|
||||
|
||||
function _mint(address user, uint256 value) internal {
|
||||
require(value > 0, "MINT_INVALID");
|
||||
_SHARES_[user] = _SHARES_[user].add(value);
|
||||
totalSupply = totalSupply.add(value);
|
||||
emit Mint(user, value);
|
||||
|
||||
@@ -32,6 +32,6 @@ interface IDVM {
|
||||
|
||||
function sellQuote(address to) external returns (uint256);
|
||||
|
||||
function buyShares(address to) external returns (uint256);
|
||||
function buyShares(address to) external returns (uint256,uint256,uint256);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ contract ERC20Factory {
|
||||
|
||||
event NewERC20(address erc20, address creator, bool isMintable);
|
||||
|
||||
// ============ Registry ============
|
||||
// creator -> token address list
|
||||
mapping(address => address[]) public _USER_STD_REGISTRY_;
|
||||
|
||||
// ============ Functions ============
|
||||
|
||||
constructor(
|
||||
@@ -50,6 +54,7 @@ contract ERC20Factory {
|
||||
) external returns (address newERC20) {
|
||||
newERC20 = ICloneFactory(_CLONE_FACTORY_).clone(_ERC20_TEMPLATE_);
|
||||
InitializableERC20(newERC20).init(msg.sender, totalSupply, name, symbol, decimals);
|
||||
_USER_STD_REGISTRY_[msg.sender].push(newERC20);
|
||||
emit NewERC20(newERC20, msg.sender, false);
|
||||
}
|
||||
|
||||
@@ -69,4 +74,13 @@ contract ERC20Factory {
|
||||
);
|
||||
emit NewERC20(newMintableERC20, msg.sender, true);
|
||||
}
|
||||
|
||||
|
||||
function getTokenByUser(address user)
|
||||
external
|
||||
view
|
||||
returns (address[] memory tokens)
|
||||
{
|
||||
return _USER_STD_REGISTRY_[user];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user