Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit f04712d

Browse files
authored
Merge pull request #68 from SetProtocol/brian/core_interface
Brian/core interface
2 parents c27b12a + f08ccaa commit f04712d

File tree

4 files changed

+180
-5
lines changed

4 files changed

+180
-5
lines changed

contracts/core/extensions/CoreAccounting.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ contract CoreAccounting is
8181
address[] _tokenAddresses,
8282
uint[] _quantities
8383
)
84-
public
84+
external
8585
isValidBatchTransaction(_tokenAddresses, _quantities)
8686
{
8787
// For each token and quantity pair, run deposit function
@@ -104,7 +104,7 @@ contract CoreAccounting is
104104
address[] _tokenAddresses,
105105
uint[] _quantities
106106
)
107-
public
107+
external
108108
isValidBatchTransaction(_tokenAddresses, _quantities)
109109
{
110110
// For each token and quantity pair, run withdraw function

contracts/core/extensions/CoreFactory.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ contract CoreFactory is
7373
string _name,
7474
string _symbol
7575
)
76-
public
76+
external
7777
isValidFactory(_factoryAddress)
7878
returns (address)
7979
{

contracts/core/extensions/CoreIssuance.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ contract CoreIssuance is
7474
address _setAddress,
7575
uint _quantity
7676
)
77-
public
77+
external
7878
isValidSet(_setAddress)
7979
isPositiveQuantity(_quantity)
8080
isNaturalUnitMultiple(_quantity, _setAddress)
@@ -155,7 +155,7 @@ contract CoreIssuance is
155155
address _setAddress,
156156
uint _quantity
157157
)
158-
public
158+
external
159159
isValidSet(_setAddress)
160160
isPositiveQuantity(_quantity)
161161
isNaturalUnitMultiple(_quantity, _setAddress)
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/*
2+
Copyright 2018 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
pragma solidity 0.4.24;
18+
19+
/**
20+
* @title ICore
21+
* @author Set Protocol
22+
*
23+
* The ICore Contract defines all the functions exposed in the Core through its
24+
* various extensions and is a light weight way to interact with the contract.
25+
*/
26+
27+
interface ICore {
28+
29+
/**
30+
* Set vaultAddress. Can only be set by owner of Core.
31+
*
32+
* @param _vaultAddress The address of the Vault
33+
*/
34+
function setVaultAddress(
35+
address _vaultAddress
36+
)
37+
external;
38+
39+
/**
40+
* Set transferProxyAddress. Can only be set by owner of Core.
41+
*
42+
* @param _transferProxyAddress The address of the TransferProxy
43+
*/
44+
function setTransferProxyAddress(
45+
address _transferProxyAddress
46+
)
47+
external;
48+
49+
/**
50+
* Add a factory to the mapping of tracked factories.
51+
*
52+
* @param _factoryAddress The address of the SetTokenFactory to enable
53+
*/
54+
function enableFactory(
55+
address _factoryAddress
56+
)
57+
external;
58+
59+
/**
60+
* Disable a factory in the mapping of tracked factories.
61+
*
62+
* @param _factoryAddress The address of the SetTokenFactory to disable
63+
*/
64+
function disableFactory(
65+
address _factoryAddress
66+
)
67+
external;
68+
69+
/**
70+
* Disable a set token in the mapping of tracked set tokens.
71+
*
72+
* @param _setAddress The address of the SetToken to remove
73+
*/
74+
function disableSet(
75+
address _setAddress
76+
)
77+
external;
78+
79+
/**
80+
* Issue
81+
*
82+
* @param _setAddress Address of set to issue
83+
* @param _quantity Quantity of set to issue. Should be multiple of natural unit.
84+
*/
85+
function issue(
86+
address _setAddress,
87+
uint _quantity
88+
)
89+
external;
90+
91+
/**
92+
* Function to convert Set Tokens into underlying components
93+
*
94+
* @param _setAddress The address of the Set token
95+
* @param _quantity The number of tokens to redeem. Should be multiple of natural unit.
96+
*/
97+
function redeem(
98+
address _setAddress,
99+
uint _quantity
100+
)
101+
external;
102+
103+
/**
104+
* Deposit multiple tokens to the vault. Quantities should be in the
105+
* order of the addresses of the tokens being deposited.
106+
*
107+
* @param _tokenAddresses Array of the addresses of the ERC20 tokens
108+
* @param _quantities Array of the number of tokens to deposit
109+
*/
110+
function batchDeposit(
111+
address[] _tokenAddresses,
112+
uint[] _quantities
113+
)
114+
external;
115+
116+
/**
117+
* Withdraw multiple tokens from the vault. Quantities should be in the
118+
* order of the addresses of the tokens being withdrawn.
119+
*
120+
* @param _tokenAddresses Array of the addresses of the ERC20 tokens
121+
* @param _quantities Array of the number of tokens to withdraw
122+
*/
123+
function batchWithdraw(
124+
address[] _tokenAddresses,
125+
uint[] _quantities
126+
)
127+
external;
128+
129+
/**
130+
* Deposit any quantity of tokens into the vault.
131+
*
132+
* @param _tokenAddress The address of the ERC20 token
133+
* @param _quantity The number of tokens to deposit
134+
*/
135+
function deposit(
136+
address _tokenAddress,
137+
uint _quantity
138+
)
139+
public;
140+
141+
/**
142+
* Withdraw a quantity of tokens from the vault.
143+
*
144+
* @param _tokenAddress The address of the ERC20 token
145+
* @param _quantity The number of tokens to withdraw
146+
*/
147+
function withdraw(
148+
address _tokenAddress,
149+
uint _quantity
150+
)
151+
public;
152+
153+
/**
154+
* Deploys a new Set Token and adds it to the valid list of SetTokens
155+
*
156+
* @param _factoryAddress address The address of the Factory to create from
157+
* @param _components address[] The address of component tokens
158+
* @param _units uint[] The units of each component token
159+
* @param _naturalUnit uint The minimum unit to be issued or redeemed
160+
* @param _name string The name of the new Set
161+
* @param _symbol string The symbol of the new Set
162+
* @return setTokenAddress address The address of the new Set
163+
*/
164+
function create(
165+
address _factoryAddress,
166+
address[] _components,
167+
uint[] _units,
168+
uint _naturalUnit,
169+
string _name,
170+
string _symbol
171+
)
172+
external
173+
returns(address);
174+
175+
}

0 commit comments

Comments
 (0)