File tree 1 file changed +9
-27
lines changed
1 file changed +9
-27
lines changed Original file line number Diff line number Diff line change 1
1
contracts . replaySafeSplit = {
2
+ address : '0xaa1a6e3e6ef20068f7f8d8c835d2d22fd5116444' ,
2
3
abi : [
3
4
{
4
5
"constant" : false ,
@@ -22,10 +23,6 @@ contracts.replaySafeSplit = {
22
23
"type" : "function"
23
24
}
24
25
] ,
25
- address : '0xaa1a6e3e6ef20068f7f8d8c835d2d22fd5116444' ,
26
- preForkAddress : null ,
27
- ethAddress : null ,
28
- etcAddress : null ,
29
26
contract : function ( ) {
30
27
return (
31
28
web3 . eth . contract ( this . abi )
@@ -36,35 +33,20 @@ contracts.replaySafeSplit = {
36
33
this . contract ( ) . at ( this . address )
37
34
) ;
38
35
} ,
39
- setAddresses : function ( preForkAddress , ethAddress , etcAddress ) {
40
- this . preForkAddress = preForkAddress ;
41
- this . ethAddress = ethAddress ;
42
- this . etcAddress = etcAddress ;
43
- } ,
44
- splitSafely : function ( value ) {
45
- if (
46
- ! this . preForkAddress ||
47
- ! this . ethAddress ||
48
- ! this . etcAddress
49
- ) {
50
- throw ( 'setAddresses(...) needs to be called before splitting!' )
51
- }
36
+ splitSafely : function ( payload ) {
52
37
return (
53
38
this
54
39
. instance ( )
55
40
. split
56
41
. sendTransaction (
57
- this . ethAddress ,
58
- this . etcAddress ,
59
- this . getPayload ( value )
42
+ payload . eth ,
43
+ payload . etc ,
44
+ {
45
+ from : payload . preFork ,
46
+ to : this . address ,
47
+ value : payload . value
48
+ }
60
49
)
61
50
) ;
62
51
} ,
63
- getPayload : function ( value ) {
64
- return ( {
65
- from : this . preForkAddress ,
66
- to : this . address ,
67
- value : value
68
- } ) ;
69
- } ,
70
52
}
You can’t perform that action at this time.
0 commit comments