@@ -10,16 +10,17 @@ async function run() {
1010 const proposerPrivateKey = process . env . INPUT_PROPOSER_PRIVATE_KEY ;
1111 const rpcUrl = process . env . INPUT_RPC_URL ;
1212 const safeAddress = process . env . INPUT_SAFE_ADDRESS ;
13- const targetAddress = process . env . INPUT_TARGET_ADDRESS ;
13+ const transactionTargetAddress = process . env . INPUT_TARGET_ADDRESS ;
1414 const safeApiKey = process . env . INPUT_SAFE_API_KEY ;
15- const chainId = BigInt ( process . env . INPUT_CHAIN_ID || '42161' ) ;
16- const transactionValue = process . env . INPUT_TRANSACTION_VALUE || '0' ;
17- const transactionData = process . env . INPUT_TRANSACTION_DATA || '0x' ;
18- const operation = process . env . INPUT_OPERATION || '0' ;
15+ const chainId = BigInt ( process . env . INPUT_CHAIN_ID || "42161" ) ;
16+ const transactionValue = process . env . INPUT_TRANSACTION_VALUE || "0" ;
17+ const transactionData = process . env . INPUT_TRANSACTION_DATA || "0x" ;
18+ // Hardcoded to 0 (Call operation) - DelegateCall (1) is not supported for security reasons
19+ const operation = 0 ;
1920
2021 core . info ( `🚀 Starting Safe transaction creation...` ) ;
2122 core . info ( `📍 Safe Address: ${ safeAddress } ` ) ;
22- core . info ( `🎯 Target Address: ${ targetAddress } ` ) ;
23+ core . info ( `🎯 Target Address: ${ transactionTargetAddress } ` ) ;
2324
2425 // Initialize wallet
2526 const wallet = new Wallet ( proposerPrivateKey ) ;
@@ -28,27 +29,27 @@ async function run() {
2829 // Initialize API Kit
2930 const apiKit = new SafeApiKit ( {
3031 chainId : chainId ,
31- apiKey : safeApiKey
32+ apiKey : safeApiKey ,
3233 } ) ;
3334
3435 // Initialize Protocol Kit
3536 const protocolKit = await Safe . init ( {
3637 provider : rpcUrl ,
3738 signer : proposerPrivateKey ,
38- safeAddress : safeAddress
39+ safeAddress : safeAddress ,
3940 } ) ;
4041
4142 // Create transaction
4243 const safeTransactionData = {
43- to : targetAddress ,
44+ to : transactionTargetAddress ,
4445 value : transactionValue ,
4546 data : transactionData ,
46- operation : parseInt ( operation )
47+ operation : parseInt ( operation ) ,
4748 } ;
4849
49- core . info ( ' 📝 Creating Safe transaction...' ) ;
50+ core . info ( " 📝 Creating Safe transaction..." ) ;
5051 const safeTransaction = await protocolKit . createTransaction ( {
51- transactions : [ safeTransactionData ]
52+ transactions : [ safeTransactionData ] ,
5253 } ) ;
5354
5455 const safeTxHash = await protocolKit . getTransactionHash ( safeTransaction ) ;
@@ -62,22 +63,23 @@ async function run() {
6263 safeTransactionData : safeTransaction . data ,
6364 safeTxHash : safeTxHash ,
6465 senderAddress : wallet . address ,
65- senderSignature : signature . data
66+ senderSignature : signature . data ,
6667 } ) ;
6768
68- core . info ( ' 📤 Transaction proposed to Safe service' ) ;
69+ core . info ( " 📤 Transaction proposed to Safe service" ) ;
6970
7071 // Get transaction details
7172 const transaction = await apiKit . getTransaction ( safeTxHash ) ;
72-
73+
7374 // Set outputs
74- core . setOutput ( ' safe-tx-hash' , safeTxHash ) ;
75- core . setOutput ( ' transaction' , JSON . stringify ( transaction ) ) ;
75+ core . setOutput ( " safe-tx-hash" , safeTxHash ) ;
76+ core . setOutput ( " transaction" , JSON . stringify ( transaction ) ) ;
7677
7778 core . info ( `✅ Transaction created successfully!` ) ;
7879 core . info ( `🔗 Transaction Hash: ${ safeTxHash } ` ) ;
79- core . info ( `📋 Transaction Details: ${ JSON . stringify ( transaction , null , 2 ) } ` ) ;
80-
80+ core . info (
81+ `📋 Transaction Details: ${ JSON . stringify ( transaction , null , 2 ) } `
82+ ) ;
8183 } catch ( error ) {
8284 core . setFailed ( `❌ Error creating Safe transaction: ${ error . message } ` ) ;
8385 core . error ( error . stack ) ;
0 commit comments