Skip to content

Commit

Permalink
Merge pull request #10773 from AugurProject/robert/clone-tokens
Browse files Browse the repository at this point in the history
cloning share token wrappers
  • Loading branch information
mergify[bot] authored Mar 8, 2021
2 parents d9c20f7 + 73265e4 commit f9e5b20
Show file tree
Hide file tree
Showing 19 changed files with 427 additions and 179 deletions.
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ jobs:
(cd packages/augur-core && yarn test:unit $(TESTS))
fi
displayName: integration tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- job: Docker_populated_geth_images
dependsOn:
Expand Down
9 changes: 8 additions & 1 deletion docs/contracts/para.md
Original file line number Diff line number Diff line change
Expand Up @@ -5099,13 +5099,20 @@ been updated. To accept the transfer(s), this must return



<div class="contract-index"><span class="contract-index-title">Functions</span><ul><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareTokens(contract IParaShareToken,uint256[],string[])"><code class="function-signature">getOrCreateWrappedShareTokens(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapShares(contract IParaShareToken,uint256,string,address,uint256)"><code class="function-signature">wrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, address _account, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapShares(contract IParaShareToken,uint256,string,uint256)"><code class="function-signature">unwrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapAllShares(contract IParaShareToken,uint256,string)"><code class="function-signature">unwrapAllShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapMultipleShares(contract IParaShareToken,uint256[],string[],address,uint256[])"><code class="function-signature">wrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, address _account, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapMultipleShares(contract IParaShareToken,uint256[],string[],uint256[])"><code class="function-signature">unwrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.publicBuyCompleteSets(contract IMarket,contract IParaShareToken,string[],uint256)"><code class="function-signature">publicBuyCompleteSets(contract IMarket _market, contract IParaShareToken _shareToken, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.publicSellCompleteSets(contract IParaShareToken,contract IMarket,string[],uint256)"><code class="function-signature">publicSellCompleteSets(contract IParaShareToken _shareToken, contract IMarket _market, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.calculateShareTokenAddress(contract IParaShareToken,uint256,string)"><code class="function-signature">calculateShareTokenAddress(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li></ul><span class="contract-index-title">Events</span><ul><li><a href="#WrappedShareTokenFactory.WrappedShareTokenCreated(contract IParaShareToken,uint256,address,string)"><code class="function-signature">WrappedShareTokenCreated(contract IParaShareToken shareToken, uint256 tokenId, address tokenAddress, string symbol)</code></a></li></ul></div>
<div class="contract-index"><span class="contract-index-title">Functions</span><ul><li><a href="#WrappedShareTokenFactory.constructor(contract WrappedShareToken)"><code class="function-signature">constructor(contract WrappedShareToken _tokenTemplate)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareTokens(contract IParaShareToken,uint256[],string[])"><code class="function-signature">getOrCreateWrappedShareTokens(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapShares(contract IParaShareToken,uint256,string,address,uint256)"><code class="function-signature">wrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, address _account, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapShares(contract IParaShareToken,uint256,string,uint256)"><code class="function-signature">unwrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapAllShares(contract IParaShareToken,uint256,string)"><code class="function-signature">unwrapAllShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapMultipleShares(contract IParaShareToken,uint256[],string[],address,uint256[])"><code class="function-signature">wrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, address _account, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapMultipleShares(contract IParaShareToken,uint256[],string[],uint256[])"><code class="function-signature">unwrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.publicBuyCompleteSets(contract IMarket,contract IParaShareToken,string[],uint256)"><code class="function-signature">publicBuyCompleteSets(contract IMarket _market, contract IParaShareToken _shareToken, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.publicSellCompleteSets(contract IParaShareToken,contract IMarket,string[],uint256)"><code class="function-signature">publicSellCompleteSets(contract IParaShareToken _shareToken, contract IMarket _market, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.calculateShareTokenAddress(contract IParaShareToken,uint256,string)"><code class="function-signature">calculateShareTokenAddress(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li class="inherited"><a href="para#CloneFactory2.createClone2(address,uint256)"><code class="function-signature">createClone2(address target, uint256 salt)</code></a></li><li class="inherited"><a href="para#CloneFactory2.clone2Address(address,uint256,address)"><code class="function-signature">clone2Address(address target, uint256 salt, address creator)</code></a></li></ul><span class="contract-index-title">Events</span><ul><li><a href="#WrappedShareTokenFactory.WrappedShareTokenCreated(contract IParaShareToken,uint256,address,string)"><code class="function-signature">WrappedShareTokenCreated(contract IParaShareToken shareToken, uint256 tokenId, address tokenAddress, string symbol)</code></a></li></ul></div>



<h4><a class="anchor" aria-hidden="true" id="WrappedShareTokenFactory.constructor(contract WrappedShareToken)"></a><code class="function-signature">constructor(contract WrappedShareToken _tokenTemplate)</code><span class="function-visibility">public</span></h4>





<h4><a class="anchor" aria-hidden="true" id="WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"></a><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol) <span class="return-arrow">→</span> <span class="return-type">contract WrappedShareToken</span></code><span class="function-visibility">public</span></h4>

creates new ERC20 wrappers for a outcome of a market
param _paraShareToken address of shareToken associated with a augur universe
param _tokenId token id associated with a outcome of a market
param _symbol symbol for the ERC20 wrapper

Expand Down
31 changes: 30 additions & 1 deletion docs/contracts/trading/wrappedShareToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -2777,6 +2777,28 @@ been updated. To accept the transfer(s), this must return



### `CloneFactory2`



<div class="contract-index"><span class="contract-index-title">Functions</span><ul><li><a href="#CloneFactory2.createClone2(address,uint256)"><code class="function-signature">createClone2(address target, uint256 salt)</code></a></li><li><a href="#CloneFactory2.clone2Address(address,uint256,address)"><code class="function-signature">clone2Address(address target, uint256 salt, address creator)</code></a></li></ul></div>



<h4><a class="anchor" aria-hidden="true" id="CloneFactory2.createClone2(address,uint256)"></a><code class="function-signature">createClone2(address target, uint256 salt) <span class="return-arrow">→</span> <span class="return-type">address</span></code><span class="function-visibility">internal</span></h4>





<h4><a class="anchor" aria-hidden="true" id="CloneFactory2.clone2Address(address,uint256,address)"></a><code class="function-signature">clone2Address(address target, uint256 salt, address creator) <span class="return-arrow">→</span> <span class="return-type">address</span></code><span class="function-visibility">public</span></h4>







### `ContractExists`


Expand All @@ -2797,13 +2819,20 @@ been updated. To accept the transfer(s), this must return



<div class="contract-index"><span class="contract-index-title">Functions</span><ul><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareTokens(contract IParaShareToken,uint256[],string[])"><code class="function-signature">getOrCreateWrappedShareTokens(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapShares(contract IParaShareToken,uint256,string,address,uint256)"><code class="function-signature">wrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, address _account, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapShares(contract IParaShareToken,uint256,string,uint256)"><code class="function-signature">unwrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapAllShares(contract IParaShareToken,uint256,string)"><code class="function-signature">unwrapAllShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapMultipleShares(contract IParaShareToken,uint256[],string[],address,uint256[])"><code class="function-signature">wrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, address _account, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapMultipleShares(contract IParaShareToken,uint256[],string[],uint256[])"><code class="function-signature">unwrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.publicBuyCompleteSets(contract IMarket,contract IParaShareToken,string[],uint256)"><code class="function-signature">publicBuyCompleteSets(contract IMarket _market, contract IParaShareToken _shareToken, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.publicSellCompleteSets(contract IParaShareToken,contract IMarket,string[],uint256)"><code class="function-signature">publicSellCompleteSets(contract IParaShareToken _shareToken, contract IMarket _market, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.calculateShareTokenAddress(contract IParaShareToken,uint256,string)"><code class="function-signature">calculateShareTokenAddress(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li></ul><span class="contract-index-title">Events</span><ul><li><a href="#WrappedShareTokenFactory.WrappedShareTokenCreated(contract IParaShareToken,uint256,address,string)"><code class="function-signature">WrappedShareTokenCreated(contract IParaShareToken shareToken, uint256 tokenId, address tokenAddress, string symbol)</code></a></li></ul></div>
<div class="contract-index"><span class="contract-index-title">Functions</span><ul><li><a href="#WrappedShareTokenFactory.constructor(contract WrappedShareToken)"><code class="function-signature">constructor(contract WrappedShareToken _tokenTemplate)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.getOrCreateWrappedShareTokens(contract IParaShareToken,uint256[],string[])"><code class="function-signature">getOrCreateWrappedShareTokens(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapShares(contract IParaShareToken,uint256,string,address,uint256)"><code class="function-signature">wrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, address _account, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapShares(contract IParaShareToken,uint256,string,uint256)"><code class="function-signature">unwrapShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapAllShares(contract IParaShareToken,uint256,string)"><code class="function-signature">unwrapAllShares(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li><a href="#WrappedShareTokenFactory.wrapMultipleShares(contract IParaShareToken,uint256[],string[],address,uint256[])"><code class="function-signature">wrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, address _account, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.unwrapMultipleShares(contract IParaShareToken,uint256[],string[],uint256[])"><code class="function-signature">unwrapMultipleShares(contract IParaShareToken _shareToken, uint256[] _tokenIds, string[] _symbols, uint256[] _amounts)</code></a></li><li><a href="#WrappedShareTokenFactory.publicBuyCompleteSets(contract IMarket,contract IParaShareToken,string[],uint256)"><code class="function-signature">publicBuyCompleteSets(contract IMarket _market, contract IParaShareToken _shareToken, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.publicSellCompleteSets(contract IParaShareToken,contract IMarket,string[],uint256)"><code class="function-signature">publicSellCompleteSets(contract IParaShareToken _shareToken, contract IMarket _market, string[] _symbols, uint256 _amount)</code></a></li><li><a href="#WrappedShareTokenFactory.calculateShareTokenAddress(contract IParaShareToken,uint256,string)"><code class="function-signature">calculateShareTokenAddress(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol)</code></a></li><li class="inherited"><a href="wrappedShareToken#CloneFactory2.createClone2(address,uint256)"><code class="function-signature">createClone2(address target, uint256 salt)</code></a></li><li class="inherited"><a href="wrappedShareToken#CloneFactory2.clone2Address(address,uint256,address)"><code class="function-signature">clone2Address(address target, uint256 salt, address creator)</code></a></li></ul><span class="contract-index-title">Events</span><ul><li><a href="#WrappedShareTokenFactory.WrappedShareTokenCreated(contract IParaShareToken,uint256,address,string)"><code class="function-signature">WrappedShareTokenCreated(contract IParaShareToken shareToken, uint256 tokenId, address tokenAddress, string symbol)</code></a></li></ul></div>



<h4><a class="anchor" aria-hidden="true" id="WrappedShareTokenFactory.constructor(contract WrappedShareToken)"></a><code class="function-signature">constructor(contract WrappedShareToken _tokenTemplate)</code><span class="function-visibility">public</span></h4>





<h4><a class="anchor" aria-hidden="true" id="WrappedShareTokenFactory.getOrCreateWrappedShareToken(contract IParaShareToken,uint256,string)"></a><code class="function-signature">getOrCreateWrappedShareToken(contract IParaShareToken _shareToken, uint256 _tokenId, string _symbol) <span class="return-arrow">→</span> <span class="return-type">contract WrappedShareToken</span></code><span class="function-visibility">public</span></h4>

creates new ERC20 wrappers for a outcome of a market
param _paraShareToken address of shareToken associated with a augur universe
param _tokenId token id associated with a outcome of a market
param _symbol symbol for the ERC20 wrapper

Expand Down
89 changes: 89 additions & 0 deletions packages/augur-artifacts/src/abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -53166,6 +53166,18 @@
}
],
"WrappedShareTokenFactory": [
{
"inputs": [
{
"internalType": "contract WrappedShareToken",
"name": "_tokenTemplate",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -53228,6 +53240,37 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "uint256",
"name": "salt",
"type": "uint256"
},
{
"internalType": "address",
"name": "creator",
"type": "address"
}
],
"name": "clone2Address",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": false,
"inputs": [
Expand Down Expand Up @@ -53367,6 +53410,21 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokenTemplate",
"outputs": [
{
"internalType": "contract WrappedShareToken",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
Expand Down Expand Up @@ -53521,6 +53579,37 @@
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"name": "wrappers",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"UniswapV2Factory": [
Expand Down
Loading

0 comments on commit f9e5b20

Please sign in to comment.