on master help sign in
contracts: add naive contract deployment
commit0bb8c692baa735b249884f962c3b71b1cec296b4 authoryosoyubik <yosoyubik@gmail.com> dateThu 26 Aug 2021, 16:06 (5 years ago) parentffffc3c
3 files changed+54
contracts/Naive.sol+15 migrations/1_migration.js+38 package.json+1
contracts/Naive.solnew file+15
@@ -0,0 +1,15 @@
1+pragma solidity 0.4.24;
2+
3+contract Naive {
4+ event Batch();
5+
6+ // This function is called for all messages sent to
7+ // this contract (there is no other function).
8+ // Sending Ether to this contract will cause an exception,
9+ // because the fallback function does not have the `payable`
10+ // modifier.
11+ //
12+ function() external {
13+ emit Batch();
14+ }
15+}
migrations/1_migration.js+38
@@ -6,6 +6,8 @@ var Ecliptic = artifacts.require('azimuth-solidity/Ecliptic');
66var DelegatedSending = artifacts.require('azimuth-solidity/DelegatedSending');
77var LSR = artifacts.require('azimuth-solidity/LinearStarRelease');
88var CSR = artifacts.require('azimuth-solidity/ConditionalStarRelease');
9+// TODO: replace when https://github.com/urbit/azimuth/pull/43 is merged
10+var Naive = artifacts.require('Naive');
911
1012const user1 = '0xD53208cf45fC9bd7938B200BFf8814A26146688f';
1113const rateUnit = 50;
@@ -87,6 +89,9 @@ module.exports = async function(deployer) {
8789
8890 const lsr = await deployer.deploy(LSR, azimuth.address);
8991
92+ // deploy naive contract
93+ const naive = await deployer.deploy(Naive);
94+
9095 const own = await ecliptic.owner();
9196 switch (process.env.WITH_TEST_STATE) {
9297 case 'STAR_RELEASE':
@@ -138,6 +143,39 @@ module.exports = async function(deployer) {
138143 await ecliptic.transferPoint(offset + 256, user1, false);
139144 }
140145 break;
146+ case 'L2':
147+ // all ships will have as owner:
148+ // 0x6deffb0cafdb11d175f123f6891aa64f01c24f7d
149+ //
150+ // ~zod -> L1
151+ await ecliptic.createGalaxy(0, own);
152+ await ecliptic.configureKeys(0, '0xffff', '0xffff', 1, false);
153+ // ~marzod -> L1
154+ await ecliptic.spawn(256, own);
155+ await ecliptic.configureKeys(256, '0xffff', '0xffff', 1, false);
156+ // ~wanzod -> L1
157+ await ecliptic.spawn(768, own);
158+ await ecliptic.configureKeys(768, '0xffff', '0xffff', 1, false);
159+ // ~wanzod sets spawn-proxy to L2
160+ await ecliptic.setSpawnProxy(
161+ 768,
162+ '0x1111111111111111111111111111111111111111'
163+ );
164+ // ~wicdev-wisryt -> L1
165+ await ecliptic.spawn(65792, own);
166+ // ~panret-tocsel -> L1
167+ await ecliptic.spawn(131328, own);
168+ // ~binzod -> L1
169+ await ecliptic.spawn(512, own);
170+ // ~norsyr-torryn -> L1
171+ await ecliptic.spawn(99549440, own);
172+ // ~norsyr-torryn -> L2
173+ await ecliptic.transferPoint(
174+ 99549440,
175+ '0x1111111111111111111111111111111111111111',
176+ true
177+ );
178+ break;
141179
142180 default:
143181 return;
package.json+1
@@ -115,6 +115,7 @@
115115 "pilot-mainnet": "REACT_APP_MAINNET=true HTTPS=true npm-run-all start --continue-on-error",
116116 "pilot-release": "WITH_TEST_STATE=STAR_RELEASE npm run pilot",
117117 "pilot-residents": "WITH_TEST_STATE=RESIDENTS npm run pilot",
118+ "pilot-l2": "WITH_TEST_STATE=L2 HTTPS=false NODE_ENV=development npm run pilot",
118119 "pilot-ropsten": "REACT_APP_ROPSTEN=true HTTPS=true npm-run-all start --continue-on-error",
119120 "pilot:cleanup": "pkill -f ganache-cli",
120121 "lint:check": "eslint 'src/**/*.{js,jsx,ts,tsx}'",