16
16
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
17
17
*/
18
18
19
- pragma solidity 0.8.23 ;
19
+ pragma solidity 0.8.27 ;
20
20
pragma experimental ABIEncoderV2;
21
21
22
22
import { IColony } from "./../colony/IColony.sol " ;
23
23
24
24
contract SetExpenditureSingleValues {
25
25
struct SetExpenditureValuesCallData {
26
- uint256 [] slots;
27
- uint256 [][] wrappedSlots;
28
26
address payable [] recipients;
27
+ uint256 [] slots;
29
28
uint256 [] skills;
30
- address [] tokens;
31
- uint256 [][] amounts;
29
+ uint256 [] amounts;
32
30
}
33
31
34
32
function setExpenditureSingleValues (
35
- address colony ,
33
+ address _colony ,
36
34
uint256 _expenditureId ,
37
35
uint256 _slot ,
38
36
address payable _recipient ,
@@ -41,44 +39,23 @@ contract SetExpenditureSingleValues {
41
39
uint256 _amount
42
40
) internal {
43
41
SetExpenditureValuesCallData memory data = SetExpenditureValuesCallData (
44
- new uint256 [](1 ),
45
- new uint256 [][](1 ),
46
42
new address payable [](1 ),
47
- new uint256 [](0 ),
48
- new address [](1 ),
49
- new uint256 [][] (1 )
43
+ new uint256 [](1 ),
44
+ new uint256 [](1 ),
45
+ new uint256 [](1 )
50
46
);
51
47
52
- if (_skillId != 0 ) {
53
- data.skills = new uint256 [](1 );
54
- data.skills[0 ] = _skillId;
55
- }
56
-
48
+ data.recipients[0 ] = _recipient;
57
49
data.slots[0 ] = _slot;
58
- data.wrappedSlots [0 ] = new uint256 []( 1 ) ;
59
- data.wrappedSlots [0 ][ 0 ] = _slot ;
50
+ data.skills [0 ] = _skillId ;
51
+ data.amounts [0 ] = _amount ;
60
52
61
- data.recipients[0 ] = _recipient;
62
- data.tokens[0 ] = _token;
63
- data.amounts[0 ] = new uint256 [](1 );
64
- data.amounts[0 ][0 ] = _amount;
53
+ IColony (_colony).setExpenditureRecipients (_expenditureId, data.slots, data.recipients);
65
54
66
- uint256 [] memory emptyUint256Array;
67
- int256 [] memory emptyInt256Array;
55
+ if (data.skills[0 ] > 0 ) {
56
+ IColony (_colony).setExpenditureSkills (_expenditureId, data.slots, data.skills);
57
+ }
68
58
69
- IColony (colony).setExpenditureValues (
70
- _expenditureId,
71
- data.slots,
72
- data.recipients,
73
- data.slots,
74
- data.skills,
75
- emptyUint256Array,
76
- emptyUint256Array,
77
- emptyUint256Array,
78
- emptyInt256Array,
79
- data.tokens,
80
- data.wrappedSlots,
81
- data.amounts
82
- );
59
+ IColony (_colony).setExpenditurePayouts (_expenditureId, data.slots, _token, data.amounts);
83
60
}
84
61
}
0 commit comments